Skip to content

🤖 fix: show task_await elapsed timing#3234

Merged
ethanndickson merged 1 commit intomainfrom
task-await-gcgf
May 6, 2026
Merged

🤖 fix: show task_await elapsed timing#3234
ethanndickson merged 1 commit intomainfrom
task-await-gcgf

Conversation

@ethanndickson
Copy link
Copy Markdown
Member

Summary

Add elapsed timing to task_await so users can see how long an await call has been running and how long completed sub-agent waits took.

Background

Bash tool calls already expose elapsed timing, but task_await only showed a generic executing state while waiting. That made long waits look stuck even when the task was still running.

Implementation

The task_await backend now surfaces elapsed_ms for sub-agent results from existing task timestamps. The task_await UI now shows live elapsed time while executing, shows row-level elapsed time for active awaited tasks when start timestamps are known, and formats completed elapsed values with the shared duration formatter.

Risks

Low. The backend change is additive because elapsed_ms was already accepted by the task_await result schema, and the UI change only adds optional timing labels around existing task_await rendering.


Generated with mux • Model: openai:gpt-5.5 • Thinking: xhigh • Cost: $17.34

Show live elapsed time while task_await calls are executing and include elapsed_ms on sub-agent task_await results when task timestamps are available.

---

_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$17.34`_

<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=17.34 -->
@ethanndickson
Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ethanndickson ethanndickson added this pull request to the merge queue May 6, 2026
Merged via the queue into main with commit c5de4e4 May 6, 2026
24 checks passed
@ethanndickson ethanndickson deleted the task-await-gcgf branch May 6, 2026 02:13
mux-bot Bot pushed a commit that referenced this pull request May 6, 2026
Dedupe the three call sites in task_await.ts that gated on the active
agent-task subset (queued | running | awaiting_report). The duplication
became especially visible in #3234, which extended both the timeout=0
and "timed out" branches symmetrically with `getAgentTaskElapsedField`,
making the two structurally identical `{ status, taskId, ...elapsed }`
returns sit a few lines apart from a third copy in the
ForegroundWaitBackgroundedError branch that picked between the same
three values.

Add a local `isAgentTaskActiveStatus` type predicate (with the
`AgentTaskActiveStatus` subset alias) at the top of the file alongside
the existing `coerceTimeoutMs` / `parseTimestampMs` helpers and replace
all three inline checks with a single call. The predicate narrows the
nullable `AgentTaskStatus | null` return of `getAgentTaskStatus` to the
active subset so the existing returns keep their narrowed `status`
field without `as const` gymnastics.

Pure refactor — emitted return shapes (including `elapsed_ms`),
narrowed `status` literals, and the existing 17-test `task_await` suite
all pass unchanged.
@mux-bot mux-bot Bot mentioned this pull request May 6, 2026
mux-bot Bot pushed a commit that referenced this pull request May 6, 2026
Dedupe the three call sites in task_await.ts that gated on the active
agent-task subset (queued | running | awaiting_report). The duplication
became especially visible in #3234, which extended both the timeout=0
and "timed out" branches symmetrically with `getAgentTaskElapsedField`,
making the two structurally identical `{ status, taskId, ...elapsed }`
returns sit a few lines apart from a third copy in the
ForegroundWaitBackgroundedError branch that picked between the same
three values.

Add a local `isAgentTaskActiveStatus` type predicate (with the
`AgentTaskActiveStatus` subset alias) at the top of the file alongside
the existing `coerceTimeoutMs` / `parseTimestampMs` helpers and replace
all three inline checks with a single call. The predicate narrows the
nullable `AgentTaskStatus | null` return of `getAgentTaskStatus` to the
active subset so the existing returns keep their narrowed `status`
field without `as const` gymnastics.

Pure refactor — emitted return shapes (including `elapsed_ms`),
narrowed `status` literals, and the existing 17-test `task_await` suite
all pass unchanged.
mux-bot Bot pushed a commit that referenced this pull request May 7, 2026
Dedupe the three call sites in task_await.ts that gated on the active
agent-task subset (queued | running | awaiting_report). The duplication
became especially visible in #3234, which extended both the timeout=0
and "timed out" branches symmetrically with `getAgentTaskElapsedField`,
making the two structurally identical `{ status, taskId, ...elapsed }`
returns sit a few lines apart from a third copy in the
ForegroundWaitBackgroundedError branch that picked between the same
three values.

Add a local `isAgentTaskActiveStatus` type predicate (with the
`AgentTaskActiveStatus` subset alias) at the top of the file alongside
the existing `coerceTimeoutMs` / `parseTimestampMs` helpers and replace
all three inline checks with a single call. The predicate narrows the
nullable `AgentTaskStatus | null` return of `getAgentTaskStatus` to the
active subset so the existing returns keep their narrowed `status`
field without `as const` gymnastics.

Pure refactor — emitted return shapes (including `elapsed_ms`),
narrowed `status` literals, and the existing 17-test `task_await` suite
all pass unchanged.
mux-bot Bot pushed a commit that referenced this pull request May 7, 2026
Dedupe the three call sites in task_await.ts that gated on the active
agent-task subset (queued | running | awaiting_report). The duplication
became especially visible in #3234, which extended both the timeout=0
and "timed out" branches symmetrically with `getAgentTaskElapsedField`,
making the two structurally identical `{ status, taskId, ...elapsed }`
returns sit a few lines apart from a third copy in the
ForegroundWaitBackgroundedError branch that picked between the same
three values.

Add a local `isAgentTaskActiveStatus` type predicate (with the
`AgentTaskActiveStatus` subset alias) at the top of the file alongside
the existing `coerceTimeoutMs` / `parseTimestampMs` helpers and replace
all three inline checks with a single call. The predicate narrows the
nullable `AgentTaskStatus | null` return of `getAgentTaskStatus` to the
active subset so the existing returns keep their narrowed `status`
field without `as const` gymnastics.

Pure refactor — emitted return shapes (including `elapsed_ms`),
narrowed `status` literals, and the existing 17-test `task_await` suite
all pass unchanged.
mux-bot Bot pushed a commit that referenced this pull request May 7, 2026
Dedupe the three call sites in task_await.ts that gated on the active
agent-task subset (queued | running | awaiting_report). The duplication
became especially visible in #3234, which extended both the timeout=0
and "timed out" branches symmetrically with `getAgentTaskElapsedField`,
making the two structurally identical `{ status, taskId, ...elapsed }`
returns sit a few lines apart from a third copy in the
ForegroundWaitBackgroundedError branch that picked between the same
three values.

Add a local `isAgentTaskActiveStatus` type predicate (with the
`AgentTaskActiveStatus` subset alias) at the top of the file alongside
the existing `coerceTimeoutMs` / `parseTimestampMs` helpers and replace
all three inline checks with a single call. The predicate narrows the
nullable `AgentTaskStatus | null` return of `getAgentTaskStatus` to the
active subset so the existing returns keep their narrowed `status`
field without `as const` gymnastics.

Pure refactor — emitted return shapes (including `elapsed_ms`),
narrowed `status` literals, and the existing 17-test `task_await` suite
all pass unchanged.
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