🤖 fix: show task_await elapsed timing#3234
Merged
ethanndickson merged 1 commit intomainfrom May 6, 2026
Merged
Conversation
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 -->
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
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 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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