Skip to content

fix(server): make mixed runtime-config update atomic (#607 follow-up) - #609

Merged
delete-cloud merged 1 commit into
mainfrom
fix/runtime-config-approval-atomicity
Jun 16, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
fix/runtime-config-approval-atomicity

Conversation

@delete-cloud

Copy link
Copy Markdown
Owner

Why

PR #607 (mid-session approval) applied approval/thinking in-place and persisted before the fallible replace_session_runtime_config call. A request mixing approval (and/or thinking) with model/provider/base_url would leave the approval policy changed on the live plugin and persisted even when the runtime replacement raised (5xx/409) — a partial, non-atomic update: session ends with new approval but old provider/model.

Fix

Reorder update_runtime_config so the fallible rebuild runs first; only after it succeeds apply thinking_config and approval — and apply them to the rebuilt updated_session so a freshly rebuilt pipeline's ApprovalPlugin gets the new policy — then persist once. Approval/thinking-only updates keep the no-rebuild fast path; 409 (turn in progress) and 400 (no fields) behavior preserved.

Test

New regression: approval + thinking + model sent together with replace_session_runtime_config monkeypatched to raise → live plugin policy, session.approval_policy, thinking_config, and the persisted store all unchanged. (Fails before the reorder.)
uv run pytest tests/ui/test_http_server.py → 268 passed.

🤖 Generated with Claude Code

PR #607 applied approval/thinking in-place and persisted BEFORE the fallible
replace_session_runtime_config call. A request mixing approval (and/or thinking)
with model/provider/base_url would leave the approval policy changed + persisted
even when the runtime replacement raised — a partial, non-atomic update.

Reorder so the fallible rebuild runs first; only after it succeeds apply
thinking_config and approval (to the rebuilt updated_session, so a new pipeline's
ApprovalPlugin gets the new policy) and persist once. Approval/thinking-only
updates keep the no-rebuild fast path. Add a regression test asserting that when
approval+thinking+model are sent together and the replacement raises, the live
plugin policy, session.approval_policy, thinking_config, and the persisted store
are all unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@delete-cloud, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 45 minutes and 5 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c3415154-ca19-4147-b852-feb403688cfd

📥 Commits

Reviewing files that changed from the base of the PR and between f89f44a and 070c643.

📒 Files selected for processing (2)
  • coding-agent/src/coding_agent/server/http_server.py
  • coding-agent/tests/ui/test_http_server.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/runtime-config-approval-atomicity

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 and usage tips.

@delete-cloud
delete-cloud merged commit 43e64ed into main Jun 16, 2026
2 checks passed
@delete-cloud
delete-cloud deleted the fix/runtime-config-approval-atomicity branch June 16, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant