Skip to content

feat(workspace): roster flag for a member whose agent is still being set up (ent#1201, A) - #4428

Merged
dolho merged 6 commits into
devfrom
feature/1201-member-handover-state
Nov 10, 2026
Merged

dolho merged 6 commits into
devfrom
feature/1201-member-handover-state

Conversation

@vybe

@vybe vybe commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

What

Workspace roster flag for a member whose own agent is still being set up (abilityai/trinity-enterprise#1201, part A of two).

  • client_portal/models.py — PortalRoster.agent_setup_pending: bool = False (fails closed: no provider, a raise, an older backend).
  • client_portal/service.py — get_roster asks portal_capabilities.has("agent_setup_pending", <caller address>); one line, no new route.
  • tests/unit/test_ent1201_roster_setup_pending.py.

The provider answering it lives in the enterprise module; without it the flag is always false. Part B (stacked on this branch) is the Workspace UI that reads it.

Rulings carried

Review + security

Reading review over A+B: MERGEABLE AFTER FIXES; both must-fix items were in part B's files and are fixed there. /cso --diff: nothing at ≥8/10.

Tests

Builder: 44 OSS passed for this checkpoint. Evidence sweep: 8 OSS backend files green in random order. Sweep marked incomplete (full frontend suite timed out with no failure) — CI's full shuffled run is the sweep.

Before merge

Part of abilityai/trinity-enterprise#1201.

🤖 Generated with Claude Code

Trinity Agent (trinity) and others added 5 commits November 9, 2026 18:08
… up (ent#1201)

PortalRoster gains agent_setup_pending (default False), filled once per
roster load from services.portal_capabilities.has("agent_setup_pending",
<caller's address>). A module that knows the person's agent is still being
prepared registers the provider; an OSS build has none and reads False, and
a provider that raises reads False (the seam fails closed).

Lets the Workspace show a "being set up" landing instead of an empty roster
while an accepted person's agent is still being seated or started.

Test: tests/unit/test_ent1201_roster_setup_pending.py — provider answer
for the caller only, once per load; no provider and a raising provider are
False; model default False. Mutation: deleting the roster line turns the
first case red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
@trinity-ability

Copy link
Copy Markdown
Contributor

/validate-pr: APPROVE (Lane B, tip 80423f6)

No code blockers. Things to do before merge:

  • regression diff is red. The one new failure, test_ent926_runtime_turn_scope::test_an_unreachable_platform_is_no_answer, is an agent-runtime test that connects to 127.0.0.1:9. It does not touch client_portal. gh run rerun 42726852069 --failed (attempt 2) is still red. That re-run is inconclusive by design: it re-diffs the same head JUnit artifact. To clear the check, re-run the whole workflow, or override it as a base flake.
  • Merge order with feat(workspace): a Build page with one guide agent per person #4255: it is open and conflicts in client_portal/models.py and client_portal/service.py.
  • Enterprise gitlink: after abilityai/trinity-enterprise#1209 merges, bump src/backend/enterprise to its merged commit.
  • Issue link: the body says Part of abilityai/trinity-enterprise#1201, and I left it that way because this is part A of 2. Put Fixes on part B (feat(workspace): member sees 'starting' and held sends while their agent restarts (ent#1201, B) #4429). Promote the cross-tracker issue by hand after B merges.

Evidence

  • Tests: tests/unit/test_ent1201_roster_setup_pending.py passes 4/4 at head.
  • Mutation: with the agent_setup_pending=portal_capabilities.has(...) kwarg deleted, test_the_roster_carries_the_providers_answer_for_the_caller goes red, so the production wiring is pinned.
  • Fails closed: with no provider the flag is False, and a provider that raises gives False.
  • Security greps (§4.1–4.10): clean. The enterprise-docs pattern has no hit.
  • Audit rows: ➖, no gated write handler.
  • Journey Impact: script exit 0.
  • §5.5 cross-surface drift: ➖, no router or agent-server twin touched.
  • Product fit: ✅ (P1 type-bug, status-ready, TD3 seam). dev-ci is green.
  • Structural review: the A+B review found no critical issues. Its I1–I7 are in part B or enterprise files.

Not run: the suites the evidence sweep already ran (rider), and /cso (the body reports nothing at ≥8/10).

🤖 Generated with Claude Code

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

@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 80423f612 (Lane B), together with abilityai/trinity-enterprise#1209 and #4429. Approving.

Verified

  • The diff is one model field, one seam call and a test. portal_capabilities.has fails closed (no provider, a raise, an empty address), and the caller's address is normalised before it is asked.
  • test_ent1201_roster_setup_pending.py runs get_roster for real: the provider's answer, the no-provider build and a raising provider. 13 passed here with test_2128.
  • Secret, address and host-path greps: clean. No public doc touched.

CI

  • regression diff is red on test_ent926_runtime_turn_scope::test_an_unreachable_platform_is_no_answer (httpcore.ConnectError). This diff does not touch that test or its code. The same test failed on #4395 at an unrelated head and passed on a re-run of the same commit, so it is an order-dependent flake on dev. Please re-run the job before merging rather than merging around it.

Non-blocking

  1. No closing keyword ("Part of …#1201"), so ent#1201 will not auto-promote. Fine for part A of two; the status needs moving by hand once part B lands.
  2. The provider is called synchronously inside async get_roster. That matches _projects_available beside it, but the enterprise provider does 3–5 DB reads per roster load (the #1209 body says so too).
  3. One finding about who the provider calls "pending" is on #1209 and #4429; it does not change this PR.

@dolho
dolho merged commit d389d26 into dev Nov 10, 2026
26 checks passed
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.

3 participants