Skip to content

feat(server): wire GatedProvider into HTTP chat paths (#649)#650

Open
kiannidev wants to merge 1 commit into
GeniePod:mainfrom
kiannidev:feat/issue-649-gated-provider-http
Open

feat(server): wire GatedProvider into HTTP chat paths (#649)#650
kiannidev wants to merge 1 commit into
GeniePod:mainfrom
kiannidev:feat/issue-649-gated-provider-http

Conversation

@kiannidev

@kiannidev kiannidev commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Closes #649

Part of #569 (gated optional API provider).

Summary

  • Add gated_provider_for_http to build a runtime GatedProvider from agent + optional-provider config
  • Store provider gate config on ChatServer via with_provider_gate
  • Route /api/chat and stream tool-finalize paths through the gated provider instead of LocalProvider::new
  • Return HTTP 503 with a clear error when optional API is enabled but misconfigured (before LLM work starts)

Remote HTTP client routing remains a follow-up under #569.

Real Behavior Proof

  • I have built and run the affected code locally.
  • I have verified the change end-to-end on Jetson hardware.
  • I have NOT verified on Jetson hardware, and I explain the equivalent verification path below.

Tested profile / hardware:

  • laptop (x86_64 Linux dev host)

What I ran

cargo test -p genie-core provider
cargo clippy -p genie-core --all-targets -- -D warnings
cargo fmt --all -- --check

What I observed

  • gated_provider_for_http_defaults_to_local_gate and existing gated-provider tests pass.
  • Clippy and fmt clean.

Test plan

  • provider_test::gated_provider_for_http_defaults_to_local_gate
  • provider_test::gated_provider_gate_off_* / gated_provider_key_missing_*
  • cargo clippy -p genie-core --all-targets -- -D warnings

Route /api/chat and stream tool-finalize paths through
gated_provider_for_http and reject misconfigured optional API gates with
503 before starting an LLM turn.
@kiannidev kiannidev force-pushed the feat/issue-649-gated-provider-http branch from f1f15f1 to bcec062 Compare July 6, 2026 16:54

@matedev01 matedev01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — this is the C1/C2 wiring we want (GatedProvider into the HTTP chat paths, #569), building on the merged #639/#648. But it's now conflicting with main (server.rs, from the #648 escalation merge). Please rebase onto current main and I'll merge — the approach is right.

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.

server: wire GatedProvider into HTTP chat completion paths

2 participants