fix(ponytail): Codex hook output — additionalContext at top level, not nested - #89
Conversation
|
Warning Review limit reached
Next review available in: 3 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Codex branch of ChangesCodex hook output format
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
crates/ponytail/src/platform.rs (2)
36-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression tests locking in the new flat Codex shape.
No test appears to cover
format_hook_outputforAgentPlatform::Codex, particularly the non-SessionStartpath (flat{"additionalContext": ctx}with nohookEventName/hookSpecificOutput) and theSessionStartpath (withsystemMessage). A regression test would prevent this shape from silently reverting to nested output.🤖 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 `@crates/ponytail/src/platform.rs` around lines 36 - 42, The Codex branch in format_hook_output currently has no regression coverage, so add tests for AgentPlatform::Codex that lock in both shapes: the non-SessionStart case should assert a flat JSON object with only additionalContext and no hookEventName or hookSpecificOutput, and the SessionStart case should assert the same flat shape plus systemMessage set to PONYTAIL:FULL. Use format_hook_output and AgentPlatform::Codex in the test names or assertions so the coverage stays tied to this path.
36-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDesign/plan docs still describe the old nested Codex contract.
The referenced spec and plan documents show the Codex output as
{"systemMessage":"...","hookSpecificOutput":{"hookEventName":"...","additionalContext":"..."}}, which no longer matches this flattened implementation. Worth a follow-up doc update so the contract docs stay authoritative.🤖 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 `@crates/ponytail/src/platform.rs` around lines 36 - 42, The Codex output contract has changed in AgentPlatform::Codex, but the spec/plan docs still describe the old nested shape. Update the referenced design/plan documents to match the current flattened output from the platform logic, using the actual fields produced by the Codex branch (including the SessionStart systemMessage behavior) so the docs remain authoritative.
🤖 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 `@crates/ponytail/src/platform.rs`:
- Around line 36-42: The Codex branch in format_hook_output currently has no
regression coverage, so add tests for AgentPlatform::Codex that lock in both
shapes: the non-SessionStart case should assert a flat JSON object with only
additionalContext and no hookEventName or hookSpecificOutput, and the
SessionStart case should assert the same flat shape plus systemMessage set to
PONYTAIL:FULL. Use format_hook_output and AgentPlatform::Codex in the test names
or assertions so the coverage stays tied to this path.
- Around line 36-42: The Codex output contract has changed in
AgentPlatform::Codex, but the spec/plan docs still describe the old nested
shape. Update the referenced design/plan documents to match the current
flattened output from the platform logic, using the actual fields produced by
the Codex branch (including the SessionStart systemMessage behavior) so the docs
remain authoritative.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: fe968eb9-eda0-43f3-a9ea-9c685a1fb2ac
📒 Files selected for processing (1)
crates/ponytail/src/platform.rs
|
@coderabbitai review |
✅ Action performedReview finished.
|
…t nested - Codex CLI expects additionalContext at JSON root, not under hookSpecificOutput - Matches upstream ponytail#508 fix - Other platforms (Claude, Copilot, Fallback) unchanged - Closes ponytail PR audit ticket #64
- Test non-SessionStart: flat JSON, no hookSpecificOutput or hookEventName - Test SessionStart: includes systemMessage with additionalContext at top level - Lock in the flattened Codex contract against regression
6b44a07 to
253dcb8
Compare
Summary by CodeRabbit