Skip to content

bug(company-os): a run-identity mismatch ends the run as COMPLETED, so a reused PID or stamp drift is billed and revoked as a success #21069

Open

Description

@mrveiss

Follow-up from review of PR #21068 (#20466).

The bug: probe_pid_identity (autobot-backend/llc/adapters/subprocess_support.py) returns COMPLETED when a live PID's identity does not match the stamp recorded at spawn (PID reuse, or stamp drift). PR #21068 adds a WARNING for this case, but the status is unchanged.

What happens then:

  • The scheduler revokes the run key and reads usage.
  • The claude_code adapter parses the output as a clean success.
  • With no result event in the output, the run is billed and recorded as successful even though it never finished.

Shipping the warning first was deliberate, because #20466's cause is not yet established on the host.

Acceptance criteria

  • An identity mismatch where the output holds no result event ends the run as FAILED (or lost), with an identity-mismatch reason, not COMPLETED.
  • An identity mismatch where a result event is present keeps today's parse. The process finished; only its PID was reused.
  • Usage is not ingested as a success for a run that ended this way (test).
  • Tests cover both branches, plus PID reuse with a live unrelated process.

Activity

  1. added
    bugSomething isn't working
    area: company-osWave 4 · cluster A — Company OS & LLC canvas
    phase:M2.5Heartbeats fire reliably
    on Nov 7, 2026
  2. mrveiss commented on Nov 7, 2026

    @mrveiss
    OwnerAuthor

    Maintainer decision: when a run's process identity does not match and the run wrote no result, it ends FAILED with a fixed reason ("run process identity mismatch (PID reused or stamp drift) - no exit result recorded"). It reuses the existing FAILED status, adds no new status and needs no migration, and the run is not billed as a success. A run that did write a result event keeps today's parse. Sequenced after #21068 and #20912.

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

    area: company-osWave 4 · cluster A — Company OS & LLC canvasbackendbugSomething isn't workingphase:M2.5Heartbeats fire reliably

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions