Commit graph

8 commits

Author SHA1 Message Date
Adil Hafeez
4845d83100 fix: address review findings from refactoring PR
- 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
2026-03-18 18:26:05 -07:00
Adil Hafeez
8ed4b36087 Merge remote-tracking branch 'origin/main' into adil/refactor_brightstaff
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
2026-03-18 18:14:38 -07:00
Adil Hafeez
bcb7f60005 merge main and resolve conflicts 2026-03-11 18:57:36 +00:00
Adil Hafeez
dd74df6ca8 refactor: decompose orchestrator handler, deduplicate headers, fix unwraps 2026-03-06 23:04:35 +00:00
Adil Hafeez
a0513fe191 fix: restore span attributes, OTEL_SERVICE_NAME, config path, and error status 2026-03-06 14:48:32 +00:00
Adil Hafeez
66e55e1621 refactor: pass AppState to handlers, add shared HTTP client, fix remaining 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>
2026-03-06 12:54:00 +00:00
Adil Hafeez
6fcecb60c3 fix: restore LLM span recordings and replace unwrap panics with proper 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>
2026-03-06 12:54:00 +00:00
Adil Hafeez
3fdd8a3a35 refactor brightstaff 2026-03-06 12:54:00 +00:00