Repository navigation
Description
Problem
AutoBot shells out to four external agent CLIs (claude, codex, copilot,
gh) and depends on specific surfaces of each — command flags, and the shape of
the JSONL/stdout stream that downstream parsers read. None of it is
version-guarded. When a CLI changes its contract, AutoBot breaks silently and
the cause is found only by debugging the symptom.
Evidence
$ grep -rn --include=*.py "min.*version\|version.*check\|--version" autobot-backend/llc/ | grep -vi test
(no output)
Contract surfaces currently depended on with no guard:
--session-idand--resumeflags (llc/adapters/claude_code_adapter.py:187-196)- the output JSONL event shape read by the rate-limit classifier
(is_rate_limit_output(),subprocess_support.py:56-70) and by the token/cost
parser that feedsBudgetService.ingest_cost_event(llc/adapters/base.py:26-31) gh auth statusexit-code semantics (copilot_subscription_adapter.py:91-107)
This has already bitten us. claude_code_adapter.py:191-196 carries a comment
explaining that without explicitly passing --session-id, the id stored for a
later --resume was one the CLI had never heard of, so every resume failed.
That is CLI-contract drift, found in production rather than by a gate — see #12683.
Proposed approach
Cheap version first, escalate only if it proves insufficient:
- Probe
<cli> --versiononce at adapter init (cached), parse it, and compare
against a known-good floor recorded per adapter. - On a version below the floor, or an unparseable version, log a loud,
actionable compat warning naming the flag/behaviour at risk — do not block. - Record the floor and why that specific version in a comment next to the
constant (which flag or output-shape dependency forced it). - A unit test asserts the floor constant exists and is referenced, so bumping a
dependency without revisiting the floor fails visibly.
A hard gate is explicitly not proposed: too strict a floor blocks users on
working setups, which is a worse failure than a warning.
Acceptance criteria
- Per-adapter known-good version floor, with the reason recorded inline
- Version probed once and cached — not per invoke
- Below-floor / unparseable version logs an actionable warning and proceeds
- Unparseable or missing
--versionoutput never crashes an invoke - Test guards the floor constants
Refs
- LLC claude_code adapter: every agent run fails on Claude 2.1.219 — fresh cmd missing --verbose (stream-json+print requires it), and resume hard-fails on stale session id with no fresh fallback #12683 — the resume-breaking CLI drift this would have caught
Notes
Found during a capability audit of the LLC adapter layer.
Activity
mrveiss commentedon Jul 31, 2026
Parent: #13096 (capability audit umbrella).
[-]LLC adapters: no version floor or compat assertion on any external agent CLI[/-][+]Company OS adapters: no version floor or compat assertion on any external agent CLI[/+]