Skip to content

feat(observe): classify codex sleep as a wait - #95

Merged
xxchan merged 2 commits into
mainfrom
tool-wait
Oct 3, 2026
Merged

xxchan merged 2 commits into
mainfrom
tool-wait

Conversation

@xxchan

@xxchan xxchan commented Oct 3, 2026

Copy link
Copy Markdown
Member

Codex sleep items arrive as tool calls since #84. classifyTool left them as other, so hosts showed "Used a tool" while the model was waiting.

What changes

  • New ToolActionKind "wait". Codex sleep maps to it.
  • New ToolAction.durationMs. For a wait, this is the duration the agent asked for, taken from the input's durationMs. It's set only when the value is a finite positive number.
  • Actual wait time. The time actually waited is the tool part's endedAt - startedAt (feat(observe): tool parts carry when OAR saw their start and end #92), since a steer can end a wait early. With both, a host can show "Waited 8 s of 50 s".
  • Labels and summaries. Labels are "Waiting" / "Waited" / "Wait failed". toolGroupSummary says "waited" or "waited N times".

Compatibility. Hosts that switch exhaustively on ToolActionKind get one more case. Otherwise the change is additive.

Tests. Classification, the duration guard, labels and the summary wording. pnpm run check passes.

🤖 Generated with Claude Code

xxchan and others added 2 commits October 3, 2026 10:10
Codex `sleep` items arrive as tool calls since #84, but classifyTool left
them as "other", so hosts said "Used a tool" for the model waiting. A new
`wait` kind carries the duration the agent asked for (`durationMs`); with
the tool part's startedAt/endedAt (#92) a host can say "Waited 8 s of
50 s", since a steer can end a wait early. Labels: Waiting / Waited, and
group summaries say "waited".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review: the wait duration was read from `durationMs` for every wait, so a
runtime naming it differently would lose it silently. The shell table is
now FIELDS, keyed by runtime and tool like before, and codex `sleep` reads
its own key through `asNumber`. The comment says the times are when OAR
saw the call start and end. Tests cover bad JSON, strings and 0, and that
groupToolActivity counts a sleep as a wait.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@xxchan
xxchan merged commit 3c4526c into main Oct 3, 2026
23 of 24 checks passed
@xxchan
xxchan deleted the tool-wait branch October 3, 2026 10:32
@xxchan xxchan mentioned this pull request Oct 3, 2026
xxchan added a commit that referenced this pull request Oct 3, 2026
Minor release, version bump only.

- #96: cursor runs through the official `@cursor/sdk` 1.0.35 in process.
Breaking for cursor: sessions opened through cursor-agent cannot be
resumed, cursor signs in with `CURSOR_API_KEY` or `Cursor.auth.login()`,
and cursor has no update check or upgrade. `SessionOptions.systemPrompt`
and `env` are refused for cursor.
- #95: `classifyTool` reads codex `sleep` as the new `wait` kind with
its `durationMs`; hosts that switch exhaustively on `ToolActionKind`
need a `wait` case.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: exe.dev user <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant