[WRONG BRANCH] fix(proxy): preserve foreground Luna routing - #285
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughShadow-call interception now receives request headers. Explicit foreground ChangesShadow-call interception
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR keeps explicitly identified foreground turns on the selected provider while preserving interception for helper calls. The localized change has passing focused validation, and no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
⏳ DRAFT
What to do
Its title has been prefixed with |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f428ea3e27
ℹ️ 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".
|
|
||
| try { | ||
| const parsed = JSON.parse(rawMetadata) as { request_kind?: unknown }; | ||
| return parsed?.request_kind !== "turn"; |
There was a problem hiding this comment.
Distinguish Codex 0.147 helper turns before bypassing
When shadow interception is enabled with Codex 0.147, background helper requests can also carry request_kind: "turn" (the preceding implementation explicitly handled lidge-jun#1684 for this case), so this condition now returns false for both genuine foreground requests and helpers. Title, commit-message, and skill-orchestration calls therefore remain on Luna instead of using the configured low-effort replacement, regressing the opt-in feature for that client version. Use an additional foreground discriminator rather than treating request_kind alone as authoritative.
AGENTS.md reference: src/AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
Motivation
request_kind: "turn"inx-codex-turn-metadata) to be rewritten to the configured shadow provider and leak user prompts to the replacement provider.Description
shouldInterceptShadowCallto acceptHeadersand to return false whenx-codex-turn-metadataparses torequest_kind: "turn", while preserving legacy prefix behavior for headerless or malformed metadata (src/lib/shadow-call.ts).req.headersinto the decision site so the Responses handler evaluates headers before rewriting model/effort (src/server/responses/core.ts).sourceModelsoverrides (tests/responses-shadow-intercept.test.ts).src/lib/shadow-call.ts,src/server/responses/core.ts,tests/responses-shadow-intercept.test.ts.Testing
./node_modules/.bin/bun test tests/responses-shadow-intercept.test.tsand it passed16tests (all green).bun run typecheckand it completed successfully../node_modules/.bin/bun scripts/privacy-scan.tsand it passed../node_modules/.bin/bun scripts/test.tssuite which exercised unrelated subsystems and encountered pre-existing timeouts/failures; the focused changes and their tests remain green.Codex Task
Summary by CodeRabbit