Skip to content

fix: tighten codex namespace invariants#91

Merged
franciscojavierarceo merged 1 commit into
mainfrom
codex/codex-namespace-followups
Jul 9, 2026
Merged

fix: tighten codex namespace invariants#91
franciscojavierarceo merged 1 commit into
mainfrom
codex/codex-namespace-followups

Conversation

@franciscojavierarceo

@franciscojavierarceo franciscojavierarceo commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • reject Codex namespace declarations whose generated flat names collide with a declared top-level function or another namespace member before building the upstream request
  • make namespace member resolution, registry construction, and RequestPayload::to_upstream_request fallible so direct callers cannot bypass collision validation
  • validate named tool_choice values with the existing NonEmptyToolName type so empty function choices are rejected at the serde boundary
  • refresh the Codex integration design doc to describe the current typed executor namespace flatten/restore path and collision behavior

Test Plan

  • cargo fmt -- --check
  • cargo test -p agentic-core --test stateful_responses_integration test_codex_namespace_collision_with_top_level_function_is_rejected --quiet
  • cargo test -p agentic-core tool::codex::tests --quiet
  • cargo test -p agentic-core --test tool_normalization_test --quiet
  • cargo test -p agentic-core codex --quiet
  • cargo clippy -p agentic-core --tests -- -D warnings
  • git diff --check
  • cargo test -p agentic-core --quiet

@franciscojavierarceo
franciscojavierarceo force-pushed the codex/codex-namespace-followups branch 2 times, most recently from 9a1cc43 to 4700030 Compare July 9, 2026 17:59
@franciscojavierarceo
franciscojavierarceo marked this pull request as ready for review July 9, 2026 18:03

@ashwing ashwing left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This closes the #84 collision case nicely — reject-before-build covers both the top-level and sibling-member clashes, and tool_choice now goes through NonEmptyToolName. Approving. One non-blocking thought inline.

Comment thread crates/agentic-core/src/types/request_response.rs Outdated
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
@franciscojavierarceo
franciscojavierarceo force-pushed the codex/codex-namespace-followups branch from 4700030 to b1274ed Compare July 9, 2026 19:02
@franciscojavierarceo
franciscojavierarceo merged commit 5c4311a into main Jul 9, 2026
3 checks passed
ashwing added a commit to ashwing/agentic-api that referenced this pull request Jul 10, 2026
The framework shipped across vllm-project#80/vllm-project#82/vllm-project#84/vllm-project#85/vllm-project#91 (with vllm-project#83/vllm-project#89 in review)
and diverged from the original proposal in several ways. Update the doc to
the design-of-record:

- Status: Proposal -> Accepted; add as-built preamble.
- ToolHandler split into ToolHandler + GatewayExecutor (execute() only
  applies to gateway-owned types); Pin<Box<dyn Future>> not #[async_trait];
  no discover()/event_prefix()/output_item_type() on the trait.
- ToolType gains CodexNamespace (6 variants); ResponsesTool shown as the
  shipped #[non_exhaustive] 7-variant enum incl. namespace + Unknown catch-all
  and the web_search aliases.
- ToolEntry carries handler: Option<Arc<dyn GatewayExecutor>>; dispatch is
  two layers (per-call registry.dispatch + multi-turn classify_round/
  LoopDecision) with a diagram.
- LoopDecision trimmed to 4 unit variants; mixed turns resolved by
  classify_round precedence, not ContinuePartial.
- Add Implementation Status (PR mapping) and Future Work (layering ADR,
  GatewayAccumulator, per-type config, remaining handlers).
- Mark Open Questions Q1-Q4 resolved; clarify collision handling is a hard
  error only for namespace-vs-top-level, warn-level last-write-wins otherwise.

Rationale sections (Principles, Alternatives Considered) preserved.

Signed-off-by: Ashwin Giridharan <girida@amazon.com>
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.

2 participants