Skip to content

fix(inbox): sub-session notification wording reflects reported task status, not just actor lifecycle#1711

Merged
wqymi merged 3 commits into
mainfrom
fix/actor-notification-wording
Jul 14, 2026
Merged

fix(inbox): sub-session notification wording reflects reported task status, not just actor lifecycle#1711
wqymi merged 3 commits into
mainfrom
fix/actor-notification-wording

Conversation

@wqymi

@wqymi wqymi commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

renderActorNotification / parseActorNotification in packages/opencode/src/inbox/render.ts had two defects in the sub-session completion notification.

Defect 1 — semantic: "completed" conflated process lifecycle with task outcome

event.status === "completed" only means the sub-session process ended cleanly. That is independent of reportedStatus (the task outcome the sub-session self-reports via **Status**: ...). A sub-session can exit cleanly while its task reportedStatus is failed/partial/blocked, yet the old text always rendered ... completed.\nStatus: unknown, misleading the user into thinking the task succeeded.

Now the completion verb aligns with reportedStatus:

  • success / partial / (absent) → completed (affirmative; a Status: line is shown only when a status was reported)
  • failed / blockedfinished (status: ...) — states the outcome, never implies success
  • unknown (ran but didn't report in **Status**: format) → neutral ended (status not reported), and the misleading Status: unknown line is dropped entirely

Defect 2 — terminology: "actor" is an internal term

The top-level wording is changed from Background actorBackground sub-session, matching the orchestrator's sub-session context. The TUI card label (routes/session/index.tsx) likewise changes actorsub-session.

Round-trip safety (#1699)

parseActorNotification is the inverse of the renderer and feeds the #1699 TUI card. The header regex is updated to recognize the new verbs (completed|finished|ended|failed|was cancelled|stalled) and a new neutral ended status is added to ParsedActorNotification (styled with a muted card). render → parse round-trip is verified by tests across every branch (success/partial/failed/blocked/unknown/completed/cancelled/stalled).

Verification

  • bun typecheck → EXIT 0
  • bun test test/inbox/parse-actor-notification.test.ts → 13 pass / 0 fail

Files changed

  • packages/opencode/src/inbox/render.ts — render verbs + parse regex/status
  • packages/opencode/src/cli/cmd/tui/routes/session/index.tsx — card ended status + "sub-session" label
  • packages/opencode/test/inbox/parse-actor-notification.test.ts — round-trip coverage for new branches

…tatus, not just actor lifecycle

Two defects in renderActorNotification/parseActorNotification:

1. Semantic: "actor completed" described the sub-session *process
   lifecycle* ending, which is independent of the task outcome. A
   sub-session can exit cleanly while its reportedStatus is
   failed/blocked, yet the old text always said "completed. Status:
   unknown", implying success. Completion wording now aligns with
   reportedStatus: success/partial → "completed"; failed/blocked →
   "finished (status: ...)" (no success implication); unknown → neutral
   "ended (status not reported)" with the misleading "Status: unknown"
   line dropped.

2. Terminology: "actor" is an internal term. Top-level wording and the
   TUI card now say "sub-session" to match the orchestrator context.

parseActorNotification (inverse) and its header regex are updated to
parse the new verbs so the #1699 TUI card keeps parsing, adding an
"ended" status. Round-trip render->parse is covered by tests.
wqymi added 2 commits July 14, 2026 19:34
… regex

Finding 1 (UX consistency): actor.ts start notification now says
'Background sub-session started.' instead of 'Background actor started.'
to match the finish notification format.

Finding 3 (backward compat): parseActorNotification regex now accepts
both 'Background sub-session' and legacy 'Background actor' formats so
old persisted notifications render as TUI cards instead of raw text.

Includes regression test for legacy 'Background actor' format.
…arted' wording

The actor notification text was changed in actor.ts:770 but the
corresponding test assertion was not updated to match.
@wqymi wqymi merged commit f17e98b into main Jul 14, 2026
6 checks passed
wqymi added a commit that referenced this pull request Jul 14, 2026
… regex

Finding 1 (UX consistency): actor.ts start notification now says
'Background sub-session started.' instead of 'Background actor started.'
to match the finish notification format.

Finding 3 (backward compat): parseActorNotification regex now accepts
both 'Background sub-session' and legacy 'Background actor' formats so
old persisted notifications render as TUI cards instead of raw text.

Includes regression test for legacy 'Background actor' format.
wqymi added a commit that referenced this pull request Jul 14, 2026
fix(inbox): sub-session notification wording reflects reported task status, not just actor lifecycle
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