Skip to content

bug(company-os): a resumed heartbeat session may not use the agent's configured model #20268

Open

Description

@mrveiss

Problem

A heartbeat agent can run on a different model from the one earlier recorded for it, and resumed sessions may never pick up a configured model.

Evidence

2026-10-31 16:45 Riga time, the run's init line reports claude-opus-5[1m]. Earlier re-test notes had this CEO on claude-sonnet-4-6, which is also the adapter default (autobot-backend/llc/adapters/claude_code_adapter.py:10).

From the code: claude_code_adapter.py:177 documents --model as a fresh-session option, and it is added at line 201-203 only for those. A resumed session therefore keeps whatever model it started with. This agent's session is resumed on every run (#20247).

Not known

The agent's stored adapter_config has not been read, so a deliberate configuration change is not ruled out. Whether this affects cost is unmeasured.

Acceptance criteria

  • The agent's configured model and the model actually running are compared on the host, and the difference explained.
  • A model change takes effect on the next run, or the UI says it needs a new session.
  • The model in use is visible on the run record.

Activity

  1. mrveiss commented on Oct 31, 2026

    @mrveiss
    OwnerAuthor

    Also found: services/execution/claude_code_backend.py:365 only checks for a leading - on a model name, so a value with spaces still passes there. It's a candidate for safe_model_arg in autobot_shared/cli_tool_flags.py from #20383.

  2. mrveiss commented on Oct 31, 2026

    @mrveiss
    OwnerAuthor

    From review of #20383: a refused safe_model_arg omits --model, so the run uses the CLI default with only a warning. Kept deliberately: failing every heartbeat over a bad config value seems worse, and the warning names the agent. Revisit with the model-on-the-run-record criterion, so the record shows what ran.

  3. github-actions commented on Nov 1, 2026

    @github-actions
    Contributor

    Landed via the merge train (#20455, merge 25ab945e81) via #20383

  4. mrveiss commented on Nov 1, 2026

    @mrveiss
    OwnerAuthor

    Landed via the merge train (PR #20455), from #20383: a resumed session now passes the configured model (claude_code_adapter.py, tests in autobot-backend/llc/adapters/tests/test_claude_code_resume_model_20268.py). Refs only; stays open. Unticked: the host comparison of configured against running model, the UI behaviour on a model change, and the model on the run record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions