Skip to content

fix(responses): flatten the Codex 0.147 functions namespace in the parser (lands #1896 subset) - #2020

Merged
lidge-jun merged 1 commit into
devfrom
codex/land-1896
Aug 18, 2026
Merged

fix(responses): flatten the Codex 0.147 functions namespace in the parser (lands #1896 subset)#2020
lidge-jun merged 1 commit into
devfrom
codex/land-1896

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

Lands the load-bearing subset of contributor PR #1896: namespace groups named functions (Codex 0.147's reserved grouping) flatten their children as top-level tools — including nested custom freeform tools like code-mode exec — while other namespaces keep MCP-style round-trip routing. The hardcoded exec/mcp_* name lists from the original are deliberately dropped pending a catalog-helper approach.

Verification

  • responses-tool-conformance + cursor-native-exec + cursor-live-transport: 60/0
  • tsc --noEmit clean

Checklist

  • Regression test included (flatten + code-mode detection)
  • Typecheck green
  • No GUI change (no screenshot required)

Summary by CodeRabbit

  • New Features

    • Improved support for custom tools, including freeform tool handling and specialized guidance for patch-based tools.
    • Added support for nested tool namespaces while preserving namespace information where applicable.
    • Enabled code mode detection for supported requests.
  • Bug Fixes

    • Built-in function tools are now presented without unnecessary namespace metadata.

Codex 0.147 groups its ordinary client tools under the reserved
`functions` namespace, including freeform custom tools such as
code-mode `exec`. Flatten those children as top-level tools (no
namespace) and lower nested custom tools the same way as top-level
ones; other namespace groups keep MCP-style round-trip routing.

Extracted from PR #1896 (credit: original author of #1896). The
code-mode rejection-guidance changes with hardcoded exec /
mcp_opencodex-responses_* name lists were intentionally dropped; a
catalog-helper approach will follow separately.
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 18, 2026
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 94d00737-3690-4a8a-b852-9e49c4140c68

📥 Commits

Reviewing files that changed from the base of the PR and between 542ea37 and 5f2b939.

📒 Files selected for processing (2)
  • src/responses/parser.ts
  • tests/responses-tool-conformance.test.ts

📝 Walkthrough

Walkthrough

The parser centralizes freeform custom-tool conversion, adds apply_patch guidance, flattens reserved functions namespaces, and preserves other namespaces. Conformance tests verify nested Codex tools and code mode detection.

Changes

Responses tool normalization

Layer / File(s) Summary
Tool conversion and namespace wiring
src/responses/parser.ts, tests/responses-tool-conformance.test.ts
buildTools uses shared pushCustom conversion for freeform tools and applies apply_patch guidance. Reserved functions namespaces flatten without namespace metadata, while other namespaces retain it. Tests cover freeform flags, namespace metadata, and code mode detection.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: wibias

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/land-1896

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.

@lidge-jun
lidge-jun deleted the codex/land-1896 branch August 19, 2026 09:17
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.

1 participant