cd /news/ai-agents/why-a-coding-agent-completion-event-… · home topics ai-agents article
[ARTICLE · art-60882] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Why a Coding-Agent Completion Event Is Not Enough

A developer at Agent Island describes a state model for monitoring coding agents like Claude Code and Codex. The model uses a completion flag, turn key, and semantic timestamp to deduplicate events and handle revocations. It combines turn timestamps with local session activity to determine if a completed turn needs user attention, with a fallback to filesystem modification time.

read1 min views1 publishedJul 15, 2026

A terminal monitor sees task_complete

. It sends an alert. The user returns and finds that the event belongs to an old turn, a background worker, or a session they already resumed.

The parser found a real event. The product state was still wrong.

Our local parser returns a completion flag, a turn key, and the event's semantic timestamp. The turn key deduplicates repeated observations. The timestamp lets later activity revoke the result.

TurnStatus {
  isDone
  turnKey
  activityDate
}

Claude and Codex need separate adapters. Claude stop reasons are not sufficient on their own because an API-error record can use a completion-shaped envelope. Codex uses event types such as task_complete

and turn/completed

.

The monitor combines the turn timestamp with newer local session activity. A fresh completed turn becomes needsYou

. Newer user activity can move it back to working, while the freshness cap eventually returns it to idle.

Filesystem modification time remains a fallback. It cannot be the main clock because bookkeeping writes do not carry the same meaning as user activity.

A longer attention window preserves alerts for users who step away, but keeps old state around longer. Watchers improve latency, but a periodic scan is still needed for dropped events. Upstream record changes require parser fixtures that cover errors and later activity, not just the happy path.

I help run Agent Island, where this state model is used for local Claude Code and Codex monitoring.

── more in #ai-agents 4 stories · sorted by recency
── more on @agent island 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/why-a-coding-agent-c…] indexed:0 read:1min 2026-07-15 ·