Skip to content

fix(responses): unwrap default.apply_patch fallback bodies - #584

Open
luvs01 wants to merge 3 commits into
devfrom
codex/fix-unwrapping-for-default.apply_patch
Open

luvs01 wants to merge 3 commits into
devfrom
codex/fix-unwrapping-for-default.apply_patch

Conversation

@luvs01

@luvs01 luvs01 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Motivation

  • A recent change normalized the helper name by stripping a default. prefix but left the wire-name used for freeform unwrapping untouched, which caused provider-emitted names like default.apply_patch to miss the apply_patch fallback vocabulary and deliver the wrapper JSON as the patch argument.
  • The intent is to restore compatibility with provider-invented default. aliases while preserving the deliberate difference between native apply_patch vocabulary and body-inferred exec behavior.

Description

  • Normalize the body wire name before selecting the apply-patch fallback vocabulary by stripping a leading default. from the resolved wire helper name in compileCodeModeHelperInput (src/responses/code-mode-helper-compat.ts).
  • Use the normalized body tool name when calling unwrapFreeformToolInput, so default.apply_patch receives the same fallback-field handling as apply_patch.
  • Add a regression test ensuring default.apply_patch with both patch and content wrappers compiles to the raw patch (tests/responses/responses-code-mode-patch-compile.test.ts).

Testing

  • Ran bun test tests/responses/responses-code-mode-patch-compile.test.ts and the focused suite passed (7 tests, 0 failures).
  • Ran bun run typecheck and bun run structure:check, both succeeded.
  • Ran the full bun run test; the focused regression passed but the full suite exited with unrelated environment/process-sensitive failures (notably tests/server/v1-hub-state.test.ts and some Unix process-group cases in tests/codex-integration/codex-shim.test.ts).

Codex Task


Devin Review

devin-ai-integration Bot and others added 2 commits September 20, 2026 13:22
…forwarded role (lidge-jun#5334 follow-up)

lidge-jun#5334 made the developer wire role tri-state: an undeclared destination folds
it to system. Two suites asserting role:"developer" on the Chat wire were
missed because they are about tool-result repair ordering and document parts,
not role selection — declare the destination, per the convention the change
established.

Verified: both files fail on dev@600075d2 with system-for-developer wire roles
and pass with the declaration.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: luvs01/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: ee2075b7-734a-44fa-a2fa-bb327392e4dc


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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 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-09-21T00:38:18.871431Z 453df76 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.

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

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

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@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: 453df76c58

ℹ️ 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 +46 to +49
const bodyToolName = wireToolName ?? helperName;
const normalizedBodyToolName = bodyToolName.startsWith("default.")
? bodyToolName.slice("default.".length)
: bodyToolName;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Update every structure owner for the changed Responses behavior

This changes the fallback-body grammar under src/responses/, but none of the six documents assigned to that area in structure/INDEX.md are updated. In particular, structure/runtime.md still says that only bare exec and apply_patch calls recover alternate body fields, which now contradicts the new default.apply_patch behavior. Update all mapped owners—or narrow the ownership map if some should not own this contract—so the documented transport behavior matches the implementation.

AGENTS.md reference: src/AGENTS.md:L11-L11

Useful? React with 👍 / 👎.

…orm contract

The responses owners still claimed only bare exec/apply_patch calls accept alternate-field or outer-fence recovery; compileCodeModeHelperInput now also unwraps provider-invented default. aliases. Update runtime.md, transports/responses.md, providers/{chat-compat,kiro,xai-grok}.md.

Co-Authored-By: Epinephrine <luvs01@hanmail.net>

This branch has not been deployed

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

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant