Skip to content

Company OS adapters: no version floor or compat assertion on any external agent CLI #13100

Open

Description

@mrveiss

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-id and --resume flags (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 feeds BudgetService.ingest_cost_event (llc/adapters/base.py:26-31)
  • gh auth status exit-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:

  1. Probe <cli> --version once at adapter init (cached), parse it, and compare
    against a known-good floor recorded per adapter.
  2. 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.
  3. Record the floor and why that specific version in a comment next to the
    constant (which flag or output-shape dependency forced it).
  4. 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 --version output never crashes an invoke
  • Test guards the floor constants

Refs

Notes

Found during a capability audit of the LLC adapter layer.

Activity

  1. mrveiss commented on Jul 31, 2026

    @mrveiss
    OwnerAuthor

    Parent: #13096 (capability audit umbrella).

  2. modified the milestones: Backlog, v0.13.0 on Sep 12, 2026
  3. changed the title [-]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[/+] on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions