Repository navigation
feat(workspace): the live execution card in chat + the Work tab history (abilityai/trinity-enterprise#525) - #2549
Merged
Merged
Conversation
…ts its history (abilityai/trinity-enterprise#525)
The visual half of ent#457. When a message starts a long-running job the
Workspace now shows it happening: a live card under the message (status word,
elapsed, the stream's last line as the current step, the steps of a published
pipeline with the agent holding each, delegated children found by the CHAT,
Stop, Open in Work) and the rail's Work tab — Waiting on you · Now · Earlier
("N in the last 30 days · latest 3 shown", Show all in place). Loop runs are
one execution kind here (ent#458 AC 3), rooms group by participant with
absence visible, and the terminal card renders from the durable #2320 verdict
so it survives a reload; "Ask about it" is a prefill, never a send — the
ruled lesser control for a restart Trinity cannot do.
Backend: client_portal/work/ — a platform-door-only read (a portal token gets
a uniform 404 before any read, ent#78) over the executions ledger under the
PORTAL roster, never the Docker-backed fleet ACL (#2196). Reuses
get_fleet_executions / get_fleet_execution_stats (the SELECT gains
source_channel, source_channel_chat_id, loop_id; the fleet model drops them,
so the dashboard payload is unchanged) plus get_running_for_chat, driven by
idx_executions_status — no migration. Every off-roster name on the payload
is masked (ent#467); titles/errors sanitized and bounded; can_stop mirrors
exactly what the terminate route accepts; a RUNNING row past 1.5× the
agent's turn bound is stale (not live, no clock, no signal, no poll). Steps
via the #919 pipeline files, hardened like pipelines.ts (id grammar before
any path, listing size before download, a streamed byte cap, safe_yaml, no
retries, 2 s in a 3 s wall budget, 10 s cache) and THREE-state: reported /
doesn't report / could not be read.
Frontend: stores/portalWork.js fed by the one owner (usePortalRailFeeds),
12 s poll only while something is live, push on agent_activity (started and
terminal) + loop events, debounced; the Work signal is ONE set merged by
execution id, never two signals summed. reattach() now sets the execution
id so Stop works after a reload.
Review fixes: the facade re-export the mixin method was missing (the
ent#277 class — a stubbed test cannot see it; a derived guard now scans the
service for every core_db call), the verdict memo beside #2320's extracted
function with its tail rule, no card for a retryable dispatch refusal.
Tests: tests/unit/test_ent525_portal_work.py (59), portalWork.spec.js (31),
neighbouring rail/loops/failed-turn specs re-pinned; full frontend suite
1965 green; live pass on the Docker stack (route 200/422/401, tab in light
and dark, Ask about it → prefill, Show all, in-chat terminal card).
Fixes abilityai/trinity-enterprise#525
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_019jmsjUAT1Q7VQbAw12YxGZ
vybe
approved these changes
Sep 6, 2026
vybe
left a comment
Contributor
There was a problem hiding this comment.
/validate-pr: APPROVE.
- Targets dev, on the dev tip; 36 files (+3481/-60), single conventional commit.
- Cross-tracker closing keyword (Fixes abilityai/trinity-enterprise#525) — accepted; ent#525 gets status-in-dev by hand after merge, closes at release.
- Docs: requirements (core-agent §5.21, scheduling §38.7), architecture/workspace.md + api-endpoints.md, new feature-flows/workspace-work.md + index, learnings.md.
- Security scans clean (keys/emails/IPs/secrets/cred files/symlinks/host paths); no compose/Dockerfile change; client_portal/ already COPYed; no new env var.
- Auth: platform-door-only via get_portal_principal.is_platform → uniform 404; roster-scoped, off-roster names dropped/masked (ent#467); chat_id honoured only for a session the caller holds; #919 read hardened (id grammar, size-before-download, streamed cap, safe_yaml, no retries, 3 s wall).
- No schema change, no migration, no MCP tool; router carries its
# mcp: noneheader. - Tests: 59 backend (door, roster, tables, children-by-chat, hardened pipeline read, facade guard, dashboard-payload pin) + 31 vitest; backend-unit-test 6 seeds + regression diff, frontend-build, frontend-e2e, secret-scan, pg-migrations all green.
5 tasks
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
PortalWorkCard) under the message that started a job — status word, elapsed, the stream's last line as the current step (ent#286), the steps of a published pipeline with the agent holding each, delegated children found by the chat (a child'sagent_nameis the delegate, so the agent filter alone can never return it), Stop (ent#155) and Open in Work. The terminal card renders from the durable bug(workspace): failed turns are invisible to the client — fast failures misreported as "lost track", backend error discarded, Retry suppressed where it is safe #2320 verdict, so it survives a reload; success collapses into the reply; Ask about it is a composer prefill, never a send (the ruled lesser control — a step-level restart is feat(mcp): introspect agent pipelines via standardized~/.trinity/pipelines/+~/.trinity/pipeline-state/#919 territory). The room renders the card for the agents the server says are working.PortalWork, docked into#tab-workin both rail mounts): Waiting on you (PortalAsksoverstore.asksfiltered to participants — the fourth rendering of the same operator-queue row, ent#428), Now, Earlier ("N in the last 30 days · latest 3 shown", Show all expands in place, "30+" when the page is full). Rooms group by participant, absence visible. Loop runs are one execution kind here — ent#458 AC 3 lands, no parallel surface.client_portal/work/— one platform-door-only read (GET …/client-portal/work?agents=&chat_id=; a portal token gets a uniform 404 before any read, ent#78's auth-path invariant per the 2026-09-06 ruling). Under the portal roster, never the fleet ACL:accessible_agent_namesresolves throughlist_all_agents_fast(), a Docker read that answers[]on a daemon fault (the bug: Workspace roster lists agents with no container (DB-sourced roster vs Docker-as-truth) #2196 class). Reusesget_fleet_executions/get_fleet_execution_stats(the SELECT gainssource_channel,source_channel_chat_id,loop_id;FleetExecutionSummarydeliberately drops them, so the operator dashboard's payload is byte-identical) +get_running_for_chatonidx_executions_status— no migration, no table, no MCP tool.Honesty rules (the review's contribution)
reported(stages) /none("this agent doesn't report steps") /unknown("could not be read right now" — stopped, unreachable, unreadable, or two runs on one agent so no instance can be attributed). A stopped agent must never be described as one that doesn't report.stale— no clock, no signal, no poll — because the 120-minute sweep leaves rows after a restart.workSignalFromItems): the conversation's emit and the feed's row for the same turn count once, never two signals summed.can_stopis computed once server-side as exactly what the terminate route accepts; every off-roster name on the payload is masked tonull(ent#467);title/errorsanitized and bounded; only aportalstamp becomes achat_id.~/.trinity/pipelines/+~/.trinity/pipeline-state/#919 read is hardened likepipelines.ts: id grammar before any path,sizefrom the listing before the download, a streamed byte cap,safe_yaml, no retries, 2 s per call in a 3 s wall budget, a 10 s per-agent cache.Changes
client_portal/work/{__init__,models,service,pipeline_state,router}.py,db/schedules/{executions,stats}.py,database.py(facade re-export),models.py(comment only),main.py(mount)components/portal/{PortalWorkCard,PortalWork}.vue,portalWork.js,stores/portalWork.js,usePortalRailFeeds.js(the Work feed joins the one owner;chatId+workEmitinputs),portalRail.js(feedsFor.work, the emit carries the id),Portal.vue,PortalConversation.vue(the card replaces the dots;reattachsets the execution id so Stop works after a reload),PortalRoom.vue,PortalAsks.vue(agentNames),clientPortal.js(fetchWork),websocket.jsarchitecture/workspace.md,api-endpoints.md, newfeature-flows/workspace-work.md+ index, residuals inworkspace-rail.md/workspace-loops.md/ scheduling §38.7,learnings.md(the facade-re-export class, with the derived guard)Test Plan
pytest tests/unit/test_ent525_portal_work.py— 59 (door, roster narrowing, the kind/outcome/can_stop tables, sanitizing/masking, the read incl. children merged by id, the hardened pipeline read, the facade guard, the dashboard-payload pin)npx vitest run— 88 files / 1965 tests green (portalWork.spec.js31: pure rules, the store under Pinia, the owner wiring, source guards);vite buildclean;check:tokensOK; loading-gate baseline unchangedGET /work200 with the unknown name dropped, 422 on the name cap, 401 unauthenticated; Work tab in light and dark; Ask about it → prefill without send; Show all → Show fewer; an in-chat terminal card under a refused turn; zero console errorsGET /workanswers 404 (unit-tested; worth one manual look with a client token)Notes for review
/autoplantaste decisions, decided per the 2026-09-02 / 09-06 rulings: steps from the pipeline contract + delegated children (not children alone); the portal route rather than/api/executions?agents=(the ACL, above); the terminal card only for non-success — and, after the live pass, only for non-retryable verdicts (a dispatch that never reached the agent keeps the red message + Retry as its honest UI)./reviewcaught the missing facade re-export (database.db.get_running_for_chat) — every stubbed test was green over an AttributeError the service's broadexceptwould have turned into a 503. Fixed, and guarded by a test that derives the required facade methods from the service source.Fixes abilityai/trinity-enterprise#525
🤖 Generated with Claude Code
https://claude.ai/code/session_019jmsjUAT1Q7VQbAw12YxGZ