feat(plugins): apply augment_prompt on Direct-API/Codex backends#421
Conversation
Plugin prompt augmentation (augment_prompt) reached the Claude SDK backend only: create_client() appends plugin contributions to the system prompt, but the Direct-API/Codex path builds its session with an empty system prompt and carries the agent's instructions in the message. So enabled plugins' prompt contributions (rules-steering-compiler, codebase-intelligence, skill-pack-runtime, ...) were silently absent from every non-claude build. Append the same augmentations to the agent message on the Direct-API path, right after the provider is resolved. Guarded on provider name so the claude provider is a no-op (it already augments via create_client) — no double application. Failures degrade to the un-augmented prompt. Covers the primary autonomous planner+coder flow (coder.py). The follow-up planner (planner.run_followup_planner) uses a separate session builder and is left for a focused follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 41 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: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 |
|
…ocs (#424) Two follow-ups to the Direct-API augment_prompt work (#421): - The follow-up planner (planner.run_followup_planner) builds its own Direct-API session with a separate builder that #421 did not cover, so plugin prompt contributions never reached it. Apply the same augmentation to its message. - Centralize the guarded helper: move the coder-local _augment_direct_api_prompt into plugins.runtime as the public augment_direct_api_prompt, and have both coder.py and planner.py call it (planner no longer needs coder-private state). - Reconcile plugin-development.md: #417 landed a note stating augment_prompt is "Claude SDK only", which #421 made false. Flip the matrix row to cover Direct-API and Codex (delivered via the agent message) and rewrite the note. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>



Problem
Plugin prompt augmentation (
augment_prompt) reached the Claude SDK backend only.create_client()appends enabled plugins' contributions to the system prompt — but the Direct-API/Codex path builds its session with an empty system prompt and carries the agent's instructions in the message. So contributions fromrules-steering-compiler,codebase-intelligence,skill-pack-runtime, etc. were silently absent from every non-claude build.Change
Append the same augmentations to the agent message on the Direct-API path, right after the provider is resolved (
coder.py). Extracted as a small helper_augment_direct_api_promptfor testability:claude(it already augments viacreate_client), so no double-application.Scope / follow-ups
planner.run_followup_planner) uses a separate session builder — left as a focused follow-up.augment_promptis "Claude SDK only." Once both land, that note'saugment_promptrow flips to ✅ for Direct-API. Kept out of this PR to avoid a same-file merge conflict; will reconcile on merge.Tests
4 new unit tests (
test_coder_prompt_augmentation.py): claude is not augmented (spy assertsapplynot called), openai/codex are augmented with the right args, and augmentation failure degrades to the base prompt. Ruff check + format clean.🤖 Generated with Claude Code