Skip to content

feat(ui): minimal Done/Failed push, skip for agent-continuation turns#272

Merged
floodsung merged 1 commit into
mainfrom
feat/minimal-done-push
May 14, 2026
Merged

feat(ui): minimal Done/Failed push, skip for agent-continuation turns#272
floodsung merged 1 commit into
mainfrom
feat/minimal-done-push

Conversation

@floodsung

Copy link
Copy Markdown
Contributor

Summary

The post-task completion notice was repeating everything already in the card's grey footer:

✅ Done (52s · $340.41 · opus-4-7 · 377.3k/1000k (38%))

But the whole point of the notice is the mobile push — card edits don't ring on Feishu mobile, text messages do. Once the user opens the chat, the card footer already shows duration / cost / model / context usage. The push banner just needs to say "the thing you asked about finished."

Changes

  • Trim notice body to `✅ Done` / `❌ Failed` — no parens, no stats. Card footer keeps the detail.
  • Skip notice for continuation turns (`handleContinuationTurn`) — those are between-turn agent activity (background task return, teammate ping, `/goal` evaluator). The user never explicitly asked for them, so a mobile push is noise. The blue→green card remains as the visual signal in-chat.
  • Preserved: 10-second threshold (quick tasks stay silent), `skipCompletionNotice` opt-out for WeChat (already routes final response as its own message), normal-turn notices on both happy path and stale-session retry.
  • Side cleanup: `startTime` in `handleContinuationTurn` was only used to compute `durationMs` for the now-removed notice — both gone.

Tradeoff

A continuation turn that ends in error (e.g. background bash task crashed and the agent's summary turn surfaces the failure) no longer pushes. The user will see the red card next time they open Feishu. If this proves to be a real problem we can re-add a notice gated on `status === 'error'` for continuation turns specifically. Leaving it out for now — the user explicitly asked for the silence.

Test plan

  • `npm run build` clean
  • `npx vitest run` — 291 / 291 pass
  • `npm run lint` — 0 errors, 2 pre-existing warnings (untouched)
  • Manual: run a >10 s user-prompted task on Feishu, confirm push notification body is exactly `✅ Done`
  • Manual: trigger a background-task continuation, confirm a card appears (blue → green) but no `✅ Done` text message follows
  • Manual: trigger a failing user-prompted task, confirm push body is `❌ Failed`

🤖 Generated with Claude Code

The completion notice was repeating everything that already sits in the
card's grey footer:

  ✅ Done (52s · $340.41 · opus-4-7 · 377.3k/1000k (38%))

The whole point of the notice is the *mobile push*: card edits don't
ring on Feishu mobile, but text messages do. Once the user opens the
chat the card itself shows duration / cost / model / context usage in
its footer — the push banner just needs to say "the thing you asked
about finished".

So the message body is now exactly:

  ✅ Done    (or ❌ Failed)

Also stop sending the notice for continuation turns
(`handleContinuationTurn`). Those are between-turn agent activity the
user didn't explicitly initiate — a background-task summary, a
teammate's reply, a `/goal` evaluator emitting. Pushing "✅ Done" for
those is meaningless: the user never asked for the work and there's
no spinning task they're waiting on. The blue-→-green card itself
remains as the visual signal in-chat; we just don't broadcast it.

The 10-second threshold and the `skipCompletionNotice` opt-out for
WeChat (which already routes the final response as its own message)
still hold. Quick tasks (<10s) stay silent.

Side cleanup: `startTime` in `handleContinuationTurn` was only used to
compute `durationMs` for the notice — both go away.

291 / 291 vitest pass. Build + lint clean (2 pre-existing warnings).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@floodsung floodsung merged commit 9bacb57 into main May 14, 2026
3 checks passed
@floodsung floodsung deleted the feat/minimal-done-push branch May 14, 2026 01:18
SimonYeyi pushed a commit to SimonYeyi/metabot that referenced this pull request May 26, 2026
…xvirobotics#272)

The completion notice was repeating everything that already sits in the
card's grey footer:

  ✅ Done (52s · $340.41 · opus-4-7 · 377.3k/1000k (38%))

The whole point of the notice is the *mobile push*: card edits don't
ring on Feishu mobile, but text messages do. Once the user opens the
chat the card itself shows duration / cost / model / context usage in
its footer — the push banner just needs to say "the thing you asked
about finished".

So the message body is now exactly:

  ✅ Done    (or ❌ Failed)

Also stop sending the notice for continuation turns
(`handleContinuationTurn`). Those are between-turn agent activity the
user didn't explicitly initiate — a background-task summary, a
teammate's reply, a `/goal` evaluator emitting. Pushing "✅ Done" for
those is meaningless: the user never asked for the work and there's
no spinning task they're waiting on. The blue-→-green card itself
remains as the visual signal in-chat; we just don't broadcast it.

The 10-second threshold and the `skipCompletionNotice` opt-out for
WeChat (which already routes the final response as its own message)
still hold. Quick tasks (<10s) stay silent.

Side cleanup: `startTime` in `handleContinuationTurn` was only used to
compute `durationMs` for the notice — both go away.

291 / 291 vitest pass. Build + lint clean (2 pre-existing warnings).

Co-authored-by: Flood Sung <floodsung@xvirobotics.ai>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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