Skip to content

A thread whose environment no longer exists still reports idle, and the message queue accepts sends into it that can never be delivered #1789

Description

@pixexid

A thread whose backing worktree has been removed continues to report status: idle with its environmentId still attached. The environment is gone from disk; nothing on the thread record says so.

Queueing a message to that thread succeeds. The CLI returns a queued-message id and the sender has every indication of success. The message will never be delivered, because there is no environment in which the thread can run. Messages accumulate indefinitely — we found four — and nothing surfaces the condition to the sender, to the recipient, or to anything reading the thread list.

Attempting to interact with the thread's environment does surface a 409, but only on that path, and only if you already suspect something is wrong. The thread record itself reports health.

Why this is worse than a lost message

A send that fails tells you to retry or escalate. A send that succeeds and is undeliverable tells you the recipient has your instruction and is working on it. In our case an agent thread had been given work orders it could never receive, while the record showed an idle, healthy worker that had simply not replied yet. The natural reading of that state — worker is fine, worker is thinking — is exactly wrong, and the longer it holds the more confident it looks.

The sender cannot distinguish this from a slow recipient on any current surface. That is what makes it indefinite rather than merely wrong.

The general form: delivery confirmation without delivery is worse than refusal, because it converts a detectable failure into an indefinite silent one.

What would resolve it

In rough order of how much it helps:

  1. Reflect missing-environment state on the thread record, so idle cannot be reported by a thread that cannot run.
  2. Reject queue sends to a thread whose environment is unavailable, rather than accepting them.
  3. Surface a queue depth that is not draining.

Related: execution-profile observability, #1787.

Activity

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

Metadata

Metadata

Assignees

Labels

partial-reproBug partially reproduced; some claims unverified; see linked reportthreadsTurns, timeline, messaging, forksworkspacesWorktrees, environments, git, shells

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions