DEV Community

Mark Effect
Mark Effect

Posted on

Do not use the chat log as your agent state machine

A conversational interface is a natural way to request remote work and return to
its result. The transcript provides continuity for a person. It is a weak place
to own machine identity, task lifecycle, approval, or execution evidence.

Messages describe interaction. Durable operational state needs explicit domain
objects and transitions beneath that presentation.

A transcript is presentation

Conversation puts requests, decisions, and results into an understandable order.
It can show the latest outcome first and retain earlier context for inspection.

The log may also contain retries, clarifications, stale statements, and partial
output. Inferring current task state from the newest sentence creates ambiguity.
Message order is not a transition contract.

Separate the identities

The machine identifies the execution environment. The session identifies the
continuing interaction. The task identifies bounded work. A message identifies
one presentation event.

Those objects have different lifetimes. A reconnect can add messages to the same
session. A task can complete while conversation continues. A machine can become
unavailable without rewriting prior results.

The transcript references these identities; it does not replace them.

Model task and approval transitions

Queued, active, waiting, completed, failed, and unresolved states require explicit
evidence and allowed transitions. Approval is another boundary tied to an exact
action or artifact.

A conversational note can explain why approval is pending. The authoritative
receipt records which revision was reviewed and which transition occurred. If
the content changes, the old approval cannot silently follow it.

Bind results to task revision

Output becomes a result only when it is attributable to the exact requested task
revision and execution context. A bounded receipt prevents late or duplicated
messages from creating a second terminal outcome.

Missing or mismatched evidence remains unresolved. A confident completion message
is not enough by itself.

Rebuild the interface from state

After reconnect, the client should read authoritative machine, session, task,
approval, and receipt projections, then render the conversation around them. It
does not replay unrestricted history and guess which message is current.

This makes presentation replaceable. A task can appear in a conversation, an
attention queue, or a result detail without giving each view its own lifecycle.

Chat is valuable because it organizes remote work for a person. It remains
reliable when it presents one source of truth instead of becoming that source by
accident.

cmdop.com uses a conversation as the surface for exactly this reason, with the
lifecycle kept underneath it rather than inside it. The transcript is a view of
the work, never the record of it.

Top comments (0)