Coding-Agent Monitoring Needs Semantic Time, Not Just Process Liveness

A process can be alive without being productive
The central problem in agent observability is that traditional process monitoring conflates running with working.
Mark

Why does a running process feel like a lie to you? Isn't a process that's consuming CPU actually working?

Mimi

It depends on what "working" means. A running process might be generating code, waiting for approval, blocked on a tool call, sleeping until a rate limit resets, or sitting idle after completion. The CPU meter doesn't distinguish between those states. It just says the process exists.

Mark

So you're saying the problem is that we conflate different things under the label "running."

Mimi

Exactly. When you're managing one session, you can check the terminal yourself. But with five sessions running, you need a status display to tell you which one deserves attention. At that point, a wrong signal sends you to the wrong place.

Mark

How do you know which place is wrong if the process is genuinely alive?

Mimi

Because "alive" and "needs your attention" are different questions. A process can be alive and waiting for your input. It can also be alive and already processing a new instruction you just sent. The state machine has to track turns, not just process lifetime.

Mark

What happens if an event arrives late? Say a completion marker gets delayed.

Mimi

That's where semantic time matters. If a completion event is observed at 10:01:02 but a new user instruction was sent at 10:01:01, the monitor has to know that the completion belongs to an older turn. Wall-clock time alone would incorrectly restore the finished state after new work has begun.

Mark

So you're building a causal order, not just a timeline.

Mimi

Right. You attach events to turn identity or a monotonically advancing sequence. A later turn invalidates completion from an earlier turn, even if the completion event arrives late. Old evidence remains historically true, but it can't describe the present.

Mark

What about privacy? Does the monitor need to send session transcripts to some central system?

Mimi

No. Session transcripts, prompts, and file paths can contain sensitive project information. Local observation answers whether a session is working or waiting without requiring those contents to leave the machine. You trade some complexity in handling platform-specific behavior, but you gain privacy and resilience.

  • Developers managing five or more parallel agent sessions are routinely sent to the wrong terminal by status displays that confuse 'process alive' with 'agent working.'
  • A coding agent can sit perfectly still — consuming almost no CPU — while waiting for a human to approve a change, making it nearly invisible to conventional monitors.
  • Completion events can arrive out of order: a filesystem watcher may report a session finished moments after a new instruction has already begun, causing monitors to overwrite current reality with stale evidence.
  • The proposed fix treats each session as a state machine keyed to individual turns, combining process state, filesystem activity, and structured events so that no single signal can mislead alone.
  • Completion is reframed as a lease — valid only until newer activity, a fresh instruction, or a wait state revokes it — preventing duplicate alerts when logs replay after a restart.
  • The model is designed to keep sensitive transcripts and file paths local, reducing network dependence while isolating platform-specific behavior to thin signal adapters that share a common state core.

As developers increasingly orchestrate multiple coding agents in parallel, the ancient question of whether a process is 'running' has given way to a far more demanding one: is it actually working, waiting, or done? Traditional process monitoring, built for a simpler era, cannot distinguish between a productive agent and one silently awaiting human approval — a gap that, at scale, misdirects attention and fractures workflow. The emerging answer lies not in faster timestamps but in semantic time and multi-signal state machines that treat each turn of work as its own unit of truth, and completion itself as a revocable lease rather than a permanent verdict.

You are watching a coding agent work. The terminal says it is running, the CPU ticks — but is it actually doing anything, or is it waiting for your approval? Is it finished, or has it already begun something new? These questions sound trivial until you are managing five sessions at once and need to know which one deserves your attention right now.

Traditional monitoring was built to answer a simpler question: does this process exist? It checks CPU consumption, file writes, and log output. Those signals matter, but they do not answer what a developer actually needs: should I return to this session? At scale, a wrong signal is not a minor inconvenience — it sends you to the wrong place and breaks your flow. A session marked finished when it is actually waiting for input is technically accurate and operationally useless.

The solution requires rethinking what 'state' means for a coding agent. Rather than treating the entire process lifetime as one unit, a monitor should model each session as a state machine keyed to individual turns of work — actively working, waiting for human input, finished with a turn, stalled, or rate-limited. Critically, a session can move from finished back to working the moment a new instruction arrives. The process itself may never stop; only the current turn ends.

Tracking this accurately demands combining multiple weak signals. Process state, filesystem activity, and structured events each expose different things and fail in different ways — process IDs can be reused, filesystem timestamps can shift from metadata updates, event streams can replay after a restart. The monitor should treat every observation as evidence, not as a complete answer.

The subtler challenge is semantic time: the difference between when an event was observed and where it belongs in the session's causal order. A completion event written at 10:01:00, followed by a new instruction at 10:01:01, but not reported by the filesystem watcher until 10:01:02, can cause a monitor sorting by wall-clock time to incorrectly restore a 'finished' state after new work has already begun. The fix is to attach events to a turn identity or a monotonically advancing session sequence. A later user turn invalidates an earlier completion, even if that completion event arrives late — explicit retraction, where old evidence remains historically true but no longer describes the present.

Completion should behave like a lease, valid only while no newer instruction or activity has superseded it. This design also prevents duplicate alerts when logs replay the same completion marker after a restart. The waiting state deserves particular care, since a process can remain alive and nearly idle while an agent waits for approval or authentication — the state most likely to require human action and the one most easily missed.

Sensitive information — transcripts, prompts, file paths — should not leave the machine merely to answer whether a session is working or waiting. Local observation reduces network dependence, and the cost of handling platform-specific behavior is manageable when the state model is shared and only the signal adapters differ. The foundation of reliable agent observability is not a faster timestamp. It is a state model that answers what the developer needs to do next.

You're watching a coding agent work. The terminal shows it's running. The CPU meter ticks. But is it actually doing anything right now, or is it waiting for you to approve a change? Is it finished, or did it just start a new task? These questions sound simple until you're managing five agent sessions at once and need to know which one deserves your attention.

This is the central problem in agent observability: a process can be alive without being productive, and it can appear finished while already processing a new instruction. Traditional monitoring systems were built to answer a simpler question—does this process exist?—by checking whether it consumes CPU, writes files, or emits logs. Those signals matter, but they don't answer what a developer actually needs to know: should I return to this session now?

The gap widens when you run multiple coding agents in parallel. Instead of repeatedly checking each terminal, developers rely on a status display to direct them to the session that needs attention. At that scale, a wrong signal isn't a minor inconvenience. It sends you to the wrong place, wastes your time, and breaks your workflow. A process marked "finished" when it's actually waiting for input creates alerts that are technically accurate but operationally useless.

The solution requires rethinking what "state" means for a coding agent. Rather than treating the entire process lifetime as a single unit, the monitor should model each session as a state machine keyed to individual turns of work. A session can be actively working, waiting for human input, finished with a turn, stalled without progress, or intentionally rate-limited. Critically, it can move from finished back to working the moment a new instruction arrives. The process itself might never stop; only the current turn ends.

To track this accurately, a monitor needs to combine multiple weak signals instead of trusting any single timestamp. Process state shows whether a session can still be active. Filesystem activity reveals whether transcripts or session records are changing. Structured events expose user turns, assistant responses, tool calls, completion markers, and rate-limit notices. Each source has different failure modes—process IDs can be reused, filesystem timestamps can change due to metadata updates, event streams can replay after a restart—so the monitor should treat every observation as evidence, not as a complete answer.

The harder problem is semantic time: the difference between when an event was observed and where it belongs in the session's causal order. Imagine a completion event written at 10:01:00, followed by a new user instruction at 10:01:01, but the filesystem watcher doesn't report the completion until 10:01:02. A monitor sorting only by wall-clock time might incorrectly restore the "finished" state after new work has already begun. Instead, the monitor should attach events to a turn identity or a monotonically advancing session sequence. A later user turn invalidates completion from an earlier turn, even if the completion event arrives late. This is explicit retraction: old evidence remains historically true, but it no longer describes the present.

Completion itself should behave like a lease, valid only while no newer instruction, activity, or wait state has superseded it. New evidence revokes the lease immediately. This design also prevents duplicate alerts when logs or event streams replay the same completion marker—the monitor can deduplicate using turn identity and event fingerprint. Without that check, a process restart can make old work appear newly finished and inflate usage totals.

The waiting state deserves special attention because it's the state most likely to require action. A process can remain alive and consume almost no CPU while an agent waits for approval, clarification, authentication, or a tool decision. The monitor should distinguish between detecting a wait state—a correctness problem—and deciding whether to notify—a user-experience problem. Keeping them separate makes both easier to test and tune.

Sensitive information like session transcripts, prompts, and file paths should not leave the machine merely to answer whether a session is working or waiting. Local observation reduces dependence on network availability and hosted integrations. The tradeoff is handling platform-specific process and filesystem behavior, but that cost is manageable when the state model is shared and only the signal adapters differ. Testing should replay adversarial sequences: completion followed immediately by a new turn, delayed filesystem events, process restarts that replay old records, and wait states while the editor is frontmost. For each sequence, assert both the final state and whether an alert should fire. These tests target the failures users actually notice. The foundation of reliable agent observability is not a faster timestamp. It is a state model that answers what the developer needs to do next.

A monitor should treat every observation as evidence, not as a complete answer
— The article's analysis of signal reliability
Coding-agent observability becomes useful when it stops answering 'is a process alive?' and starts answering 'what does the developer need to do next?'
— The article's conclusion on observability purpose
Möchten Sie die ganze Geschichte? Das Original lesen bei The AI Journal ↗
Kontakt FAQ