Repository navigation
fix(bub-acp-server): stop leaking "auto" effort and harden session store - #103
Merged
frostming merged 1 commit intoNov 11, 2026
Merged
Conversation
Two robustness fixes for concurrent and multi-provider ACP usage: 1. Never forward the literal "auto" reasoning effort into model requests. "auto" is the ACP-facing placeholder for "no explicit effort"; providers reject the literal value (400 invalid_request_error on strict routes) or silently ignore it, so sessions either failed or ran with unpredictable thinking behavior depending on the gateway route. Skip the field and let each model use its own default. 2. Persist acp-sessions.json through a per-process temp file and tolerate a lost replace() race. Concurrent `bub acp` instances share the store; with the fixed ".json.tmp" name, one process renaming the temp file crashed the other with FileNotFoundError during startup.
Gabyran
force-pushed
the
fix/acp-auto-effort-and-session-store-race
branch
from
November 11, 2026 07:22
26f569f to
7c6017c
Compare
frostming
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two robustness issues in
bub-acp-server, both hit in real multi-session usage:The literal string
"auto"is forwarded asreasoning_effortinto model requests.autois the ACP-facing placeholder for "no explicit effort" (the default of the session config option), but_build_inboundpasses it through verbatim. Strict providers reject it (400 invalid_request_error: Invalid value: 'auto', observed on two different gateways); lenient ones silently ignore it. So sessions either fail or run with unpredictable thinking behavior depending on the route.Concurrent
bub acpinstances crash on startup withENOENT.All instances share
<BUB_HOME>/acp-sessions.jsonand_save_sessions()writes it through a fixed.json.tmptemp name followed byreplace(). When several instances start at once (e.g. an orchestrator spawning several ACP sessions), one process renames the temp file away before the other'sreplace(), and the losing process crashes:[Errno 2] No such file or directory: '.../acp-sessions.json.tmp' -> '.../acp-sessions.json'Fix
_runtime_reasoning_effortwhen the configured value isauto, so each model uses its own default behavior — matching what "auto" means in the UI..json.<pid>.tmp) and treat a lostreplace()race as a lost update instead of crashing.Tests
test_auto_reasoning_effort_is_not_forwarded: a session configured withautomust not leak_runtime_reasoning_effortinto the model request context.test_save_sessions_tolerates_concurrent_store_rotation: areplace()that loses the race must not raise and must not leave temp files behind.packages/bub-acp-serversuite: 211 passed; ruff check and format clean.