Repository navigation
fix: admit Codex fco_ function_call_output IDs (#547) - #554
Closed
justrightnow wants to merge 1 commit into
Closed
justrightnow wants to merge 1 commit into
justrightnow wants to merge 1 commit into
Conversation
Codex stamps the function_call_output items it builds for locally executed tools with an fco_ ID, but InOutItem::admit only accepted the fc_ prefix for that item type, so the second turn of any tool-using Codex session was refused with 400 invalid_value. Admit both fc_ and fco_ for function_call_output while keeping fc_ canonical for generated IDs and the only accepted spelling for function_call. The admitted spellings are described by one IdPrefixes value and listed in the InvalidId error message; id_prefix() stays the canonical accessor so storage still mints fc_ and recorded cassettes are unchanged. Correlation still rides on call_id, validated separately. Signed-off-by: Jack Wei <weike@chinamobile.com>
justrightnow
requested review from
bbrowning,
franciscojavierarceo,
haoshan98,
jiahuei,
leseb,
maralbahari,
noobHappylife,
qandrew and
tjtanaa
as code owners
November 16, 2026 12:56
Collaborator
|
@justrightnow i am working on this in #553 with correction on recording openai behavior. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #547.
Codex stamps the
function_call_outputitems it builds for locally executed tools with anfco_ID.InOutItem::admit(types/io/item/item_id.rs) admitted onlyfc_for that item type, so the follow-up turn of any tool-using Codex session was refused with400 invalid_value, and the client replays the same history on every retry, so the thread never recovers. BothPOST /v1/responses(input) andPOST /v1/conversations/{id}/items(items) go throughInOutItem::admit_all.This admits
fc_andfco_forfunction_call_output:IdPrefixes { canonical, alternative }value owns the admitted spellings per item type;InOutItem::admitvalidates against it and theInvalidIdmessage lists every admitted spelling ('fc' or 'fco').id_prefix()remains the canonical accessor, sostorage/types/item.rsstill mints onlyfc_public IDs and recorded cassettes are unchanged.function_callstill accepts onlyfc_; anfco_ID that mislabels a call is still refused. The ID namespace stays type-distinct.call_id, validated separately — the ID is only a reference handle.Scope is limited to the admission rule; no storage schema, generated-ID, or cassette changes.
Test Plan
cargo fmt -- --check→ clean.cargo clippy --workspace --all-targets -- -D warnings→ clean (no warnings).cargo build --workspace→ clean.cargo test --workspace --no-fail-fast(isolated target dir, full rebuild): 3154 passed / 25 ignored / 2 failed. The 2 failures aremessages_test::..._unreachable_upstreamasserting502but receiving504; they reproduce identically on pristinemain(a bound-but-unlistened loopback socket times out on macOS) and do not touch the item/admission/conversations path — pre-existing, unrelated to this change.item_id.rs:fco_output admitted,function_callwithfco_still refused with only'fc'listed, invalid output ID lists both spellings, and a replayedfco_...UUIDoutput admitted throughadmit_all.codex_function_call_output_ids_are_admitted_over_http(crates/agentic-server/tests/conversations/regressions.rs): real gateway + in-memory SQLite,fco_output admitted (200) and persisted with its ID intact viaGET .../items; wrong-prefix and mistyped-ID cases return 400 with the correct wording.agentic-serverbinary (SQLite,--skip-llm-ready-check, no model call needed for conversation routes): issue Codex tool results are refused: function_call_output does not admit the fco_ ID prefix #547's exactcurlnow returns 200; wrong prefix returns 400 listing'fc' or 'fco';function_callwithfco_returns 400 listing only'fc'; canonicalfc_output still 200.conversations_api_cassette_test,responses_api_test,conversation_storage_regressions,conversations_test) all pass — no recorded OpenAI error bodies changed.All under the pinned Rust 1.98.1 toolchain.