Skip to content

feat(workspace): member sees 'starting' and held sends while their agent restarts (ent#1201, B) - #4429

Merged
dolho merged 4 commits into
feature/1201-member-handover-statefrom
feature/1201-member-handover-ui
Nov 10, 2026
Merged

dolho merged 4 commits into
feature/1201-member-handover-statefrom
feature/1201-member-handover-ui

Conversation

@vybe

@vybe vybe commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What

Workspace UI for a member while their own agent is set up or restarted (abilityai/trinity-enterprise#1201, part B, stacked on part A — base feature/1201-member-handover-state).

  • A "being set up" landing instead of an empty roster when agent_setup_pending is true (Portal.vue, PortalSidebar.vue, portalProgress store).
  • During a restart the member's row reads ready (no "Unavailable" chip, no DRAFT, no owner naming); the card says "Your assistant is starting".
  • Sends while the assistant starts are held in the composer ("will send when it's ready"), sent automatically when it is ready, handed back after 3 min. The held text is kept in the chat's saved draft, so a reload or closed tab does not lose it.
  • A member's send refused because the agent is not running returns the text to the composer (same as the neighbouring refusal).
  • Member tier decided from the card (is_member_agent && !owned); a stopped member agent outside a hand-over shows "Restarting".
  • Specs: portalMemberHeldSend.mount, portalMemberTierDetails.mount, portalRosterSetupPending, portalSetupPendingStage.mount, portalSidebarSetupPending.mount, plus updates.

Rulings carried

  • Operator ruling: no chip or banner during the restart; held sends, 3-min ceiling; the over-time line uses fallback wording ("we're looking into it").
  • Member tier only for the owner-naming change (every-viewer fix is a handoff).
  • "Restarting" is the sidebar chip copy for a stopped member agent outside a hand-over — named here for the operator.
  • The chain built this UI past its usual one-component scope by operator decision; the UI is checked at the operator's review.

Review + security

Reading review: MERGEABLE AFTER FIXES. Fixed on this branch: I1 held send lost on reload (3a0a7a1e5), I2 refused member send was a dead end (3a0a7a1e5), and three cheap items — set-up sidebar line past the ceiling, refusal copy parity (2ce7456aa). Each fix has a spec that goes red when the fix is reverted. /cso --diff: nothing at ≥8/10.

Builder deviations, reviewed: liveness timer cap 2→3 (for the 3 s poll); messages with files attached are not held; the member refusal is recognised by the server's "needs to start it" text (no category field).

Tests

Fix step: 11 files / 95 tests (touched specs + source-text, raw-color, loading-gate ratchets); neighbours (every portal*, draft, composer, turnCancel spec) 176 files / 2,781 tests passed. Raw colors: 0 raw non-gray, 0 hardcoded in the touched components; PortalConversation semantic tokens 52→54. Full vitest was not run to completion (sweep hit its 560 s cap at ~2,365 tests, 0 failures). Stacked PR: backend-unit-test and CodeQL do not run until this retargets dev.

Before merge

Handoffs

Part of abilityai/trinity-enterprise#1201.

🤖 Generated with Claude Code

Trinity Agent (trinity) and others added 4 commits November 9, 2026 18:20
A person on an agent shared to them as a member (is_member_agent && !owned,
read off the card) is never told to ask an account to start it:

- portalUtils: viewerIsMemberTier, assistantStarting (the assistant_ready
  progress step in progress) and memberTierRefusal. availabilityChip and
  composerAvailabilityNotice take { memberTier, starting }: a member-tier
  card reads "Restarting" / "Your assistant is restarting." with no owner,
  and nothing at all while the assistant is starting.
- PortalConversation: a send while the member's assistant is starting is
  held ("will send when it's ready"), sent when the step flips to done,
  handed back as text if it failed or after 3 minutes, and kept as the
  chat's draft on unmount. A 502 "needs to start it" refusal reads as
  restarting for a member.
- PortalAgentDetails: the hard-coded detailed chip follows the same rule.

Tests: portalAvailabilityChip.spec.js (member-tier block, red on the base
for the owner-name assertions), portalMemberHeldSend.mount.spec.js and
portalMemberTierDetails.mount.spec.js (mounted; red before the wiring).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the roster says the viewer's own agent is still being set up
(agent_setup_pending), the Workspace says so instead of "No agents shared
with you yet":

- clientPortal store: agentSetupPending (raised only by a roster that says
  exactly true) and refreshRoster(), a quiet re-read that never re-enters
  the loading phase and leaves the screen as it was on a failed read.
- portalProgress store: startingFor(agent), off the one cached card.
- PortalSidebar: an empty roster that is being set up shows one line,
  "Your assistant is being set up"; a member's row shows no chip while its
  assistant is starting (progress read for member rows only).
- Portal.vue: the same line on the bare stage, where the conversation will
  mount; a quiet 3 s roster poll only while pending, stopped at a 3-minute
  ceiling (setupPollVerdict) with "This is taking longer than usual — we're
  looking into it."; a member's assistant_ready step flipping re-reads the
  roster once.

Tests: portalRosterSetupPending.spec.js, portalSidebarSetupPending.mount,
portalSetupPendingStage.mount (Portal.vue mounted, fake timers), startingFor
in portalProgressStore.spec.js, setupPollVerdict in
portalAvailabilityChip.spec.js; all red before the change.
portalUnreadLiveness.spec.js's setInterval bound moves 2 -> 3 for the
bounded set-up poll, with the reason in the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d comes back (ent#1201)

I1 — holding a send emptied the composer, and the write-through draft
persisted that empty field; only unmount wrote the held words back, and a
reload or a closed tab runs no unmount hook. While a send is held its words
are now the chat's draft (ahead of anything typed since, post-flush after
useComposerDraft's own write), and the draft lets go of them once the hold
ends — sent on the ready flip, or handed back to the composer.

I2 — a member-tier 502 ("its owner needs to start it", rewritten to
"restarting") returned no restoreText, so the words stayed only on the
struck, non-retryable message. It now hands them back to the composer the
way the #3460 refusal three lines above does.

Mutations (fix reverted from a scratch copy, restored byte-identical):
- held-draft watcher removed -> RED "survives a reload: the held words are
  the chat's draft until sent or handed back"
- draft not released on send (`|| !h`) -> RED same spec ("hello there" vs '')
- restoreText dropped on memberCopy -> RED "hands the refused words back to
  the composer"

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rity (ent#1201)

Review follow-ups inside PR B's own files:
- I5: past the 3-min poll ceiling the stage said "taking longer" while the
  sidebar still said "being set up". Both now read one pair of lines from
  portalUtils, and the shell passes setupOverdue to the sidebar.
  Mutations: wiring removed -> RED portalSetupPendingStage "stops after three
  minutes…"; sidebar ternary removed -> RED portalSidebarSetupPending "past
  the ceiling it says what the stage says".
- I7: the member 502 rewrite matches free server text. A spec reads every
  availability refusal from client_portal/service.py and runs it through
  memberTierRefusal (consumer: CI). Mutation: frontend regex changed -> RED.
- I6: the progress-store spec fixture renamed to a neutral member-bob /
  member-amy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vybe vybe added the ui PR touches the frontend UI — triggers Playwright e2e tests label Nov 10, 2026
@trinity-ability

Copy link
Copy Markdown
Contributor

/validate-pr — APPROVE (conditional), no blockers

Validated against the stacked base feature/1201-member-handover-state (not dev), tip 2ce7456aa. Lane B (frontend-only, 15 files), no schema.

Check Result
Neighbour specs (every spec importing a changed source file) 197 files / 3,226 tests passed (run here, at tip)
Fix mutations at tip refused-send text-back removed → red; held-draft watcher disabled → red (file restored byte-identical)
Review fixes I1, I2 (3a0a7a1e5), I5–I7 (2ce7456aa) present
Security greps / docs guard / host paths clean
Journey Impact script exit 0
Cross-surface drift, audit rows, packaging n/a (no router, backend or agent-server file)
PR-side CI (reduced set) build, e2e, guard, gitleaks, schema-parity, verify-non-root green
dev-ci success

Warnings

  • W1 — no closing keyword (Part of …). Not patched, because the issue spans two PRs and lives in the other tracker. Bump the issue's status by hand after merge.
  • W2 — review item I4 (extra roster reads on every newly opened agent, plus the 3 s poll running with an agent already on screen) is not fixed and not listed as a follow-up.
  • W3 — review item I3 (a step stuck in_progress never ends) belongs to part A and is still open. The held-send ceiling stops it hurting a sender, but it needs a follow-up.
  • W4 — portalUnreadLiveness timer cap was raised from 2 to 3. This is a disclosed deviation, but the guard is looser.

Not run here — at retarget / before merge

  • Full Tier 1 (backend-unit-test, regression diff, CodeQL, frontend-build) runs only once this retargets dev. Merge feat(workspace): roster flag for a member whose agent is still being set up (ent#1201, A) #4428 first, retarget, then require green.
  • The full vitest suite has never run to completion on this branch (the sweep hit its cap at about 2,365 tests with 0 failures).
  • Live check of a member joining: the row stays ready, "starting" shows, and a held send goes out on ready.

@vybe
vybe marked this pull request as ready for review November 10, 2026 00:52
@dolho
dolho merged commit 2f1ad2e into feature/1201-member-handover-state Nov 10, 2026
12 of 14 checks passed

@dolho dolho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed with /validate-pr at 2ce7456aa (Lane B, stacked on #4428), against abilityai/trinity-enterprise#1209. Leaving a comment rather than an approval: one finding to settle first.

Verified

  • The 8 touched spec files plus the raw-colour, loading-gate and source-text ratchets: 11 files, 95 passed. The five new specs mount components; none reads source text.
  • A held send is kept as the chat's draft, sent when assistant_ready leaves in_progress, and handed back to the composer on failed or after 3 minutes. A send with files is not held, as documented.
  • fetchRoster({ quiet: true }) leaves loading, error, unavailable and rosterLoaded alone, and still handles a 401.
  • The member-tier copy names no account, and memberTierRefusal falls back to the server's words for any other viewer or refusal.

Finding (please settle before merge): the set-up state has no end for a person with nothing on the way
Details and proof are on abilityai/trinity-enterprise#1209: the provider reports "pending" for anyone who accepted the current terms and has no member row, however long ago. In this PR that becomes:

  • watch(() => store.agentSetupPending) in Portal.vue starts the 3-second refreshRoster poll whenever the flag is true, with or without agents on the roster. The 3-minute ceiling is in-memory, so it restarts on every Workspace load: up to 60 roster reads per load, each asking the provider again.
  • With an empty roster, PortalSidebar.vue and the stage show the set-up line, then "taking longer — we're looking into it", in place of "No agents yet. Create one →" for a platform user.

On an existing instance that turns member agents on, that is every user who had already accepted the terms. The fix belongs in the provider (bound the no-row case by the acceptance's age); if you would rather bound it here, remember the ceiling across loads.

Non-blocking

  1. memberTierRefusal matches the server's sentence with /needs to start it/. The specs pin the same string, but nothing ties it to client_portal/service.py:614-622; if that copy changes, members quietly get the owner wording back. A machine-readable code on the 502 would remove the coupling.
  2. portalUnreadLiveness's timer cap goes 2 → 3 (disclosed in the body). Noting it because it loosens a guard.
  3. Base is feature/1201-member-handover-state; retarget to dev after #4428 merges, as the body says. CI here shows changes / report cancelled, which is the stacked base, not a failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants