fix(codex): rewrite unsupported tool references#1133
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThis PR adds a transformer that converts Claude-style tool references into Codex-compatible instruction wording, applies it in the Codex command adapter, and wires tool-specific transformer selection into init, update, and workspace skill-generation flows. ChangesCodex tool reference transformation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/core/command-generation/adapters.test.ts (1)
324-334: ⚡ Quick winAdd one positive assertion for transformed semantics.
This test only checks removed tokens; it can still pass if the whole line is accidentally dropped. Add one expected replacement assertion (for example,
Ask the user in chat...) to lock behavior.✅ Minimal test hardening
expect(output).not.toContain('Task tool'); expect(output).not.toContain('subagent_type'); + expect(output).toContain('Ask the user in chat'); });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/core/command-generation/adapters.test.ts` around lines 324 - 334, The test "should replace unsupported runtime tool references" currently only asserts that unsupported tokens are removed; update the test that calls codexAdapter.formatFile with sampleContent to also assert a positive transformed phrase is present (e.g., add expect(output).toContain('Ask the user in chat') or similar) so the test verifies replacement semantics rather than just deletion; keep existing negative checks for 'AskUserQuestion', 'TodoWrite', 'Task tool' and 'subagent_type' and add one clear positive assertion referencing the expected transformed text produced by codexAdapter.formatFile.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/core/command-generation/adapters.test.ts`:
- Around line 324-334: The test "should replace unsupported runtime tool
references" currently only asserts that unsupported tokens are removed; update
the test that calls codexAdapter.formatFile with sampleContent to also assert a
positive transformed phrase is present (e.g., add expect(output).toContain('Ask
the user in chat') or similar) so the test verifies replacement semantics rather
than just deletion; keep existing negative checks for 'AskUserQuestion',
'TodoWrite', 'Task tool' and 'subagent_type' and add one clear positive
assertion referencing the expected transformed text produced by
codexAdapter.formatFile.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 84f7cfe3-11be-4be4-bf3b-aa1d913ea3a1
📒 Files selected for processing (7)
src/core/command-generation/adapters/codex.tssrc/core/init.tssrc/core/update.tssrc/core/workspace/skills.tssrc/utils/command-references.tstest/core/command-generation/adapters.test.tstest/utils/command-references.test.ts
b1124ea to
a51272d
Compare
Summary
Tests
AskUserQuestion|TodoWrite|Task tool|subagent_typeNotes
pnpm testhas one environment-dependent existing failure locally:test/commands/artifact-workflow.test.ts > creates skills for Cursor toolexpects.cursor/commands/opsx-explore.md, but my global OpenSpec config isdelivery: skills, so that command file is not generated.Fixes #1103
Summary by CodeRabbit
New Features
Tests