Skip to content

fix(responses): keep external task input a user turn in raw-body repairs (carry #6769) - #6795

Merged
lidge-jun merged 7 commits into
devfrom
codex/compaction-responses-carry
Oct 9, 2026
Merged

lidge-jun merged 7 commits into
devfrom
codex/compaction-responses-carry

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

Maintainer carry of #6769 by @robin-bially, so the full CI can run on an origin branch. Refs #6764.

Codex submits an external task as a function_call_output that has id, name and namespace but no pairing call_id. The parser already reads that envelope as a user turn, but the raw-body repairs in the Responses passthrough (repairUnidentifiedToolOutputItems, repairOrphanedInputItems) wrapped it as [tool output for unknown call]. A routed compaction summarizer then read the authorized handover as a stray tool result.

After this change both raw-body repairs emit a recognized envelope as a plain user message, using the parser's own recognizer (externalTaskInputResponsesContent in src/responses/task-input.ts). Image detail original maps to high, as on translated routes. Ordinary orphaned outputs keep the existing marker.

Maintainer changes on top of the contributor's three commits:

  • Any nonempty string call_id, including whitespace, stays a tool result in both repairs. The request schema accepts a whitespace call_id as a function_call_output and strips the envelope fields (src/responses/schema.ts), so the parsed path treats it as a tool result and the raw path now agrees. A regression test pins that parity against parseRequest.
  • The docs (docs-site adapters reference and sub-agent guide, structure/providers/chat-compat.md) now say the mapping applies to passthrough and routed (portable) compaction; the direct native /responses/compact forward keeps its existing raw-body handling.
  • devlog/_plan/261009_l3_compaction_responses/ records the lane roadmap for this and two related carries.

The issue also reports a Claude continuation picking an already completed task after a correct summary. Task selection after replay is not changed here, so this references #6764 rather than closing it.

Co-authored-by: Robin Bially 7304732+robin-bially@users.noreply.github.com

Verification

  • bun test tests/responses/external-task-input-repair.test.ts tests/responses/openai-responses-passthrough.test.ts tests/responses/responses-compaction-routing.test.ts tests/responses/responses-parser.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts: 432 pass, 0 fail.
  • The whitespace call_id regression test fails with the source fix reverted (1 fail) and passes with it.
  • bun run typecheck, bun run structure:check, bun run privacy:scan: pass.
  • tests/responses/openai-responses-passthrough.test.ts stays at its 4809-line cap; structure/providers/chat-compat.md stays at 600 lines.
  • Independent gpt-6-sol code review: PASS at the final source commit after two repair rounds.
  • The full bun run test suite was not run locally (lane constraint: minimal local tests, several worktrees running in parallel on this machine). Exact-head hosted CI is the full-suite evidence.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. No auth, credential or workflow code changes; no new logging.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 9, 2026 01:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T02:02:30.110537Z 4544aff PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8c20eda9-4453-417b-a5fc-9b33424af8b5
📥 Commits

Reviewing files that changed from the base of the PR and between c15037b and 4544aff.

📒 Files selected for processing (13)
  • devlog/_plan/261009_l3_compaction_responses/000_plan.md
  • devlog/_plan/261009_l3_compaction_responses/010_carry_6769_external_task_input.md
  • devlog/_plan/261009_l3_compaction_responses/020_carry_6746_hosted_search_compaction.md
  • devlog/_plan/261009_l3_compaction_responses/030_carry_6741_claude_native_reasoning.md
  • docs-site/src/content/docs/guides/sub-agent-surface.md
  • docs-site/src/content/docs/reference/adapters.md
  • scripts/test-layout/layout.json
  • src/adapters/openai-responses/tool-output-recovery.ts
  • src/responses/task-input.ts
  • structure/providers/chat-compat.md
  • tests/fixtures/test-layout-expected.json
  • tests/responses/external-task-input-repair.test.ts
  • tests/responses/openai-responses-passthrough.test.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4544affcf3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +44 to +47
3. Amend `tests/responses/external-task-input-repair.test.ts`: add a case where
`call_id: " "` external task input reaches the passthrough `buildRequest` and becomes the same
user message the parser produces, and a case where a real `call_id` with `id/name/namespace`
stays a tool output.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Align the plan with whitespace call-id handling

This plan instructs the next maintainer to promote an envelope with call_id: " " to a user message, but the committed implementation deliberately does the opposite: repairUnidentifiedToolOutputItems returns every nonempty string call ID unchanged, and the new regression test asserts that whitespace remains a tool result because Zod accepts it and strips the envelope metadata. Since this open roadmap also lists promotion as an acceptance criterion, following it would reintroduce the parser/raw-path mismatch that the final source change avoids; update the amendment, test instructions, and acceptance section to describe the behavior actually committed.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants