Skip to content

refactor brightstaff#736

Merged
adilhafeez merged 16 commits intomainfrom
adil/refactor_brightstaff
Mar 20, 2026
Merged

refactor brightstaff#736
adilhafeez merged 16 commits intomainfrom
adil/refactor_brightstaff

Conversation

@adilhafeez
Copy link
Copy Markdown
Contributor

@adilhafeez adilhafeez commented Feb 10, 2026

  • Extract AppState struct; rewrite main.rs with focused helpers and ? error propagation
  • Add graceful shutdown via tokio::select! (ctrl-c handling)
  • Restructure handlers/ into agents/ and llm/ also restructured tracing

@adilhafeez adilhafeez marked this pull request as ready for review February 10, 2026 09:02
adilhafeez and others added 4 commits March 6, 2026 12:54
…r errors

- Restore llm.model, llm.tools, llm.user_message_preview, llm.temperature
  span field recordings that were lost during refactor
- Replace agents.as_ref().unwrap() and agent_map.get().unwrap() in
  orchestrator with proper error returns
- Replace from_endpoint().unwrap() with ok_or_else returning 400
- Replace to_bytes().unwrap() with match returning 500

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ining unwraps

- Pass Arc<AppState> directly to llm_chat and agent_chat instead of
  destructuring into individual parameters
- Add shared reqwest::Client to AppState for connection pooling on
  upstream LLM requests
- Fix unwrap panics in pipeline.rs: get_new_session_id now returns
  Result, invoke_agent to_bytes properly handled
- Fix unwrap panics in orchestrator.rs: strip_prefix and pop
- Fix unwrap panics in response.rs: SSE parsing no longer panics
- Fix unwrap panics in router services: serialization errors propagated
- Convert old-style string-format debug log in state/mod.rs to
  structured tracing fields

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@adilhafeez adilhafeez force-pushed the adil/refactor_brightstaff branch from 061aa74 to 66e55e1 Compare March 6, 2026 13:13
…taff

Made-with: Cursor

# Conflicts:
#	crates/brightstaff/src/main.rs
#	crates/brightstaff/src/router/plano_orchestrator.rs
…taff

Made-with: Cursor

# Conflicts:
#	crates/brightstaff/src/handlers/agents/orchestrator.rs
#	crates/brightstaff/src/handlers/agents/pipeline.rs
#	crates/brightstaff/src/handlers/llm.rs
#	crates/brightstaff/src/main.rs
- Replace unreachable!() with proper error return in orchestrator agent chain
- Remove incorrect #[allow(dead_code)] on routing_provider_name
- Change SerError alias to _ (trait import for method resolution only)
- Remove dead commented-out code in pipeline.rs
- Replace unwrap()s with expect/if-let in LLM handler filter paths
- Make find_listener synchronous (no await needed)
- Unify message truncation logic via streaming::truncate_message

Made-with: Cursor
@adilhafeez adilhafeez merged commit 1ad3e0f into main Mar 20, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant