Skip to content

feat(go): add provider-shaped routing decisions - #1149

Closed
afourniernv wants to merge 1 commit into
codex/go-decide-parked-basefrom
codex/go-decision-api
Closed

afourniernv wants to merge 1 commit into
codex/go-decide-parked-basefrom
codex/go-decision-api

Conversation

@afourniernv

@afourniernv afourniernv commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Parked for now. Agent Router uses Route plus the translation helpers, so this API is outside the initial Go-binding stack.

What

Add Router.Decide as a thin Go wrapper around the C bridge's sy_decide_new. Hosts pass provider JSON and receive the normalized routing outcome plus ordered, provider-shaped candidate requests.

Rust handles decoding, candidate preparation, and reply decoding. Go keeps callback execution, cancellation, and cleanup. Typed decision calls keep their existing protocol.

Why

Go gateways should not assemble the codec sequence themselves. This uses the shared C implementation rather than keeping a separate Go implementation of that sequence.

How tested

  • Native tests on Go 1.22.12 and the current local toolchain, with race detection and GOEXPERIMENT=cgocheck2.
  • Fresh native library and WASM guest builds; both backend suites passed, including race tests and vet.
  • OSS Agent Router spike: four focused tests, the full processor package tests, and vet passed with cgo disabled and a localhost mock judge.
  • Rust workspace tests, strict Clippy, formatting, Ruff, and 198 hermetic Python tests passed.

No live provider calls or actual Envoy/Enterprise deployment.

Notes for reviewers

Its original base is preserved on codex/go-decide-parked-base, including the C support from #1156. The full implementation, including WASM integration, is preserved on codex/go-decide-parked-full-stack. Neither draft blocks the active Go-binding stack.

Adds one Go method and five supporting types. Existing public Go types and Route are unchanged. No additional C exports or dependency changes in this PR; build the matching C library.

Outcomes retain the normalized request, optional answer, and evidence. Algorithm-produced answers remain normalized. Candidate requests are prepared eagerly. Preparation errors end the run, while ordinary host errors follow the algorithm's policy.

@afourniernv
afourniernv force-pushed the codex/go-review-02-native branch from 5370b9b to aa03539 Compare October 26, 2026 20:12
@afourniernv
afourniernv force-pushed the codex/go-decision-api branch from 0b7ea99 to 7304f01 Compare October 26, 2026 20:12
@afourniernv
afourniernv force-pushed the codex/go-review-02-native branch from aa03539 to f192fd7 Compare October 27, 2026 20:26
@afourniernv
afourniernv force-pushed the codex/go-decision-api branch 2 times, most recently from 0fa58fc to 84ab67f Compare October 27, 2026 23:44
@afourniernv
afourniernv force-pushed the codex/go-review-02-native branch from f192fd7 to 6fdf6ac Compare October 27, 2026 23:44
Signed-off-by: Alex Fournier <afournier@nvidia.com>
@afourniernv
afourniernv force-pushed the codex/go-review-02-native branch from 6fdf6ac to 2668e6d Compare October 28, 2026 00:09
@afourniernv
afourniernv force-pushed the codex/go-decision-api branch from 84ab67f to 12cb73d Compare October 28, 2026 00:09
@afourniernv
afourniernv force-pushed the codex/go-review-02-native branch from 2668e6d to 6e2803d Compare October 28, 2026 00:40
@afourniernv
afourniernv changed the base branch from codex/go-review-02-native to codex/go-decide-parked-base October 28, 2026 00:41
@afourniernv

Copy link
Copy Markdown
Contributor Author

Closing for now since Agent Router uses Route and the translation helpers. Keeping the branch so we can reopen if a caller needs Decide.

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