Repository navigation
feat(assistant): the assistant leads the first session (abilityai/trinity-enterprise#1355) - #4736
Conversation
… session (abilityai/trinity-enterprise#1355) When the instance's assistant status says it leads setup, the first-run dialog does not open by itself; it is still available on request (Re-run setup / ?onboarding=1). It also waits until the corner is decided, so it never opens and then yields. Installs where the assistant does not lead are unchanged. Tests: predicate cases in firstRunSteps.spec.js; a mounted dialog in firstRunOverlayAssistantLeads.mount.spec.js pins the store wiring (reverting the ctx line turns 'does not open where the assistant leads' red). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… two answers (abilityai/trinity-enterprise#1355) Where the assistant leads setup and the person has no agent of their own, the panel opens by itself (any width, unless closed before) and asks one question: 'I already run agents in Claude Code' / 'Start from scratch'. Start from scratch, or any typed answer, goes to the assistant with the question it answers. The other button is a hand-off stub said on the page (its own work: abilityai/trinity-enterprise#1353); nothing is sent. utils/firstSession.js holds the page's words for this session and the step names, in one place, for journey events (abilityai/trinity-enterprise#1352). Nothing new is emitted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ion (abilityai/trinity-enterprise#1355) Each turn of the assistant-led first session carries first_session: true in its context, so the assistant follows its script for that session (website link, three proposed agents, Build). Other sessions send nothing new. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ns by itself (abilityai/trinity-enterprise#1355) - connect-claude card: a masked Anthropic API key field in the panel, checked and saved on this instance exactly as Settings does; the key is never part of a message, and the assistant hears only 'Done: Connect Claude.'. utils/firstSession.js::CLAUDE_SIGN_IN is the one seam where the one-button sign-in (abilityai/trinity-enterprise#1354) replaces the field. - A run that ends well carries 'Open the result' (the execution page). Where the assistant leads setup, the first such result opens beside the panel by itself, once. - The first-session context stays on until that first result is seen, so the assistant keeps its script through build, connect and run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… screen (abilityai/trinity-enterprise#1355) Where the assistant leads the first session: - the agents the install came with are filtered out of the dashboard fleet (network store, before the owner filter, so every pane and the graph agree) until the person has an agent of their own, or presses 'Show the example agents Trinity came with'; - the panel's getting-started list and the stage nudge (connect a model in Settings) wait until the first session is over. Installs where the assistant does not lead are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keeps both sides of the conflict: - AssistantWidget startTalking(): #4735's openingDecided gate (agent list and example names read, status settled) now also gates the first-session OPENING, so the question is never decided on an early, incomplete status or an empty fleet that has not loaded yet. - stores/assistant greet(): the first-session early return and #4735's dedupe of an opener already on screen. - The panel spec: both describe blocks. Validator notes on #4735 taken: the pending-opening placeholder no longer hides on statusError, so a failed settle re-read keeps it instead of leaving a blank conversation; and its bars use the pre-status skeleton's grays. Tests (each shown red under the matching mutation, then restored): - first-session question waits for the settled status (red with the old `!store.status` gate); - waits for the agent list: a person with their own agent gets the hello (red with `prepared` dropped from openingDecided); - a failed re-read keeps the placeholder (red with `&& !store.statusError`); - dashboardHidesExamples.mount.spec.js: how the Dashboard decides which example agents to hide (system agent not counted as own, hand-off to the network store, show-on-request remembered, cleared on unmount). Refs abilityai/trinity-enterprise#1355 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ses the shared credential field (abilityai/trinity-enterprise#1355) Brings the branch up to dev (a604afd, the assistant's masked credential field, abilityai/trinity-enterprise#1358) and resolves the panel onto it, so the panel has one credential card: - the first session's own connect-claude card is gone: assistantCards no longer accepts it, the widget's masked key input and the store's connectClaude (which tested and saved the key from the page) are removed. The assistant asks for ANTHROPIC_API_KEY with ask_credential and the shared field saves it on this instance. - the shared field, for this instance's Claude credential only, shows where to get it (an API key at Anthropic) and, after the save, the agents it connected (the save's connected_agents) and the instance's own check of the saved key: working false is said on the card and appended to the "Provided:" line the assistant hears. The value is on neither. - CLAUDE_SIGN_IN stays the one seam for the Claude step, reshaped for abilityai/trinity-enterprise#1354 as { name, label, href }: the field shows the sign-in link and the person pastes the code into the same field. Not built. - enterprise gitlink -> 4766764 (the check after the save and the count). - assistantCredentialField.mount.spec.js: its vue-router mock gains useRouter, which this branch's widget uses; no assertion changed. Tests: assistantWidget.mount.spec.js first-run block rewritten (3): the first-session path stores through POST /api/enterprise/assistant/credential and never /api/settings/api-keys, a rejected key is said without the value, a connect-claude card renders nothing. Assistant/first-session/credential/ ratchet specs 362 passed; enterprise assistant + credential 178 passed. Mutation: dropping the rejection suffix in credentialLine turns 'a key Anthropic rejects after the save...' red. Co-Authored-By: Claude Opus 5.5 <[email protected]>
/validate-pr: APPROVE once Tier 1 and the lane-C runs are green (validator run XsCeM4B5n3JEwNbhNhJF_A, head 72e3e5d)Lane C, because the PR moves the
The gateway's |
…ne (abilityai/trinity-enterprise#1355) Validation XsCeM4B5n3JEwNbhNhJF_A flagged the removed !store.statusError guard on the opening placeholder. The retry error renders only while there is no status, in the branch beside the conversation, so the placeholder cannot pulse under it; putting the old guard back would blank the panel when a settle re-read fails with the status on screen (the test added with it). Pinned with a mount test instead: the first reads fail, the error shows, nothing aria-busy beside it. Mutation: the loading skeleton rendered under the error turns it red. Co-Authored-By: Claude Opus 5.5 <[email protected]>
/validate-pr re-validation: APPROVE once re-pinned and Tier 1 is green (validator run Zqjq3aKcBH1mjog-KtmXmA, head cd6c227)Lane C (the enterprise pointer moves). I am not the fix run. The placeholder guard: the fix run's claim holds, checked by probe. In
Specs: the 6 touched specs plus the raw-color, loading-gate and source-text ratchets, at Merge order (the pointer)
CI: CodeQL (both), Still open from last time: no closing keyword (the issue closes manually at release), and the description still mentions the removed The gateway half is still REQUEST CHANGES (Abilityai/trinity-gateway#26, a pool-exhaustion residual on the website reader). It affects availability only, not the link-provenance fix. This PR only sends |
…terprise pin 636c6d5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… enterprise#1360 squash-merged to main (abilityai/trinity-enterprise#1355) The pointer is moved deliberately to exactly 26ccbb379929c978c74797803d3b852f9caff222, the squash-merge of abilityai/trinity-enterprise#1360 on enterprise main (the status saying when the assistant leads the first session). It replaces the pre-merge branch commit 4766764 that this branch pinned before, and descends from 636c6d5, the pin dev carries since #4744, so nothing on dev is dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n (abilityai/trinity-enterprise#1355) The placeholder test covered only the no-status branch, where the conversation is never rendered, so rendering the error beside the conversation too stayed green (re-validation Zqjq3aKcBH1mjog-KtmXmA, mutation b). It now also mounts a settle where the status is on screen and the re-read fails (statusError set), and asserts the retry error never shows while the conversation input does. Mutation: an InlineError on statusError inside the conversation branch makes "a failed first read shows the retry error alone" go red (expected [250, 250, 250, 500, 500, 1000, 2000] to deeply equal []). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Fix continuation after re-validation Zqjq3aKcBH1mjog-KtmXmA, head
|
|
Regression details (head_sha: `d2ae30f6ab1add9a8468801a9b9bfdca72d08207`)Seed Backend unit-suite regression diffPer-XML totals
❌ New failures introduced by HEAD (1)Tests failing under HEAD that did not fail under BASE in any seed:
Legend: [F] = assertion failure, [E] = collection or fixture error. Reproduce locally: |
Re-validation (third pass, fix commits only) —
|
|
Merge gate update: |
|
Resolve by merging |
…token or an API key, tested before it is saved (Abilityai/trinity-enterprise#1354) (#4752) * feat(assistant): connect Claude with a sign-in link and a pasted code, no terminal (Abilityai/trinity-enterprise#1354) The instance runs the sign-in `claude setup-token` runs (PKCE, Claude Code's public client id, the manual redirect, scope user:inference, a one-year token) with the instance as the client, so a person with only a browser can connect their Claude subscription: * POST /api/subscriptions/claude-sign-in makes a fresh link for the caller; the PKCE verifier stays on the instance (Redis, bound to the caller, 15 min, single use). * POST /api/subscriptions/claude-sign-in/exchange takes the pasted `<code>#<state>`, spends the link, exchanges the code and registers the token as `primary` through POST /api/subscriptions' own handler, so encryption, the first-credential connect of waiting agents and the #2572 sweep are unchanged. The token is never returned. * Refusals are named and store nothing (code_incomplete, sign_in_expired, code_rejected, anthropic_unavailable, unexpected_answer, store_unavailable); a missing encryption key is refused before the code is spent. Person + admin only. No code, state or token in any log line. The assistant's Claude card (the CLAUDE_SIGN_IN seam left by #4736) now shows three steps with the instance's link, the API key as the alternative in the same field, and a fresh link after a refused paste. The instance's Claude card is held as CLAUDE_SUBSCRIPTION, which the enterprise side routes by shape (sign-in code, sk-ant-oat01-, sk-ant-api). The enterprise pin moves to that change (trinity-enterprise branch feature/ent1354-claude-sign-in). Tests: tests/unit/test_ent1354_claude_sign_in.py (21); assistantClaudeSignIn.mount.spec.js (5, mounted through the real widget and store). Mutations: dropping the per-person binding turns test_another_persons_link_does_not_finish_for_you red; dropping the pre-exchange encryption check turns test_the_code_survives_a_missing_encryption_key red. Two existing assertions updated for the new name (assistantCredentialField, assistantWidget). Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(assistant): the sign-in exchange is person-pinned, audited and answers inside the assistant's wait (Abilityai/trinity-enterprise#1354) - Provider timeout 30 s -> 8 s: the code is spent when the exchange starts, and the assistant's loopback gives up at 30 s with "may or may not have been stored"; the provider now ends in a named refusal well before that. - A successful exchange writes a credentials/subscription_signed_in audit row: subscription name and actor only, never the token or the code. - A paste that is plainly an API key (sk-…, ant-api…) is answered api_key_not_code with the API-key format message, without spending the link. - Tests: assert_person on both routes is pinned by principals that pass assert_admin (system scope, agent-vouched) — red with the check deleted; every refusal the exchange can give is checked for the paste; the timeout is pinned against the enterprise side's when it is mounted. - Enterprise pointer -> 3adcdca (the #1376 branch head: token tested before it is saved). Red before the fix: TestAnApiKeyInTheCodeField (x3), TestTheAuditRow, and test_the_provider_timeout_is_well_under_the_assistants_wait. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(assistant): connect Claude by pasting a token made in a terminal; remove the instance sign-in (Abilityai/trinity-enterprise#1354) Ruled 2026-11-24 after legal's read: "we will go with terminal key creation and pasting into system." The instance no longer starts a sign-in with the provider or exchanges a code. Removed, not flagged off: - services/claude_sign_in_service.py (PKCE link, the per-person Redis-held verifier, the code exchange, the provider client id and endpoints) - POST /api/subscriptions/claude-sign-in and .../claude-sign-in/exchange, their models (ClaudeSignInLink, ClaudeSignInExchange) and the subscription_signed_in audit row - tests/unit/test_ent1354_claude_sign_in.py and its registry entry - the store's claudeSignInLink and the card's link fetch - the api-endpoints / feature-flow rows for the two routes Kept: the card, now three short steps (open a terminal on your own computer, run claude setup-token, paste the token it prints here) with an Anthropic API key as the alternative in the same field. Routing by shape, test-before-save, the plain refusals (a '#' paste is told a token is expected) and the card's audit row live in the enterprise pin, bumped to f88740b (Abilityai/trinity-enterprise#1376). Tests: assistantClaudeToken.mount.spec.js (renamed from assistantClaudeSignIn) + credential field + widget + ratchets, 163 passed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(enterprise): pin the Claude card's test-first API key (Abilityai/trinity-enterprise#1354) Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(enterprise): re-pin to 7d2b825 — trinity-enterprise#1376 merged to main (Abilityai/trinity-enterprise#1354) Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Trinity Agent (trinity) <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Plan: which repo carries which step (abilityai/trinity-enterprise#1355)
/statussaysleads_setupfirst_sessioncontextANTHROPIC_API_KEY, result link, first result opensask_credentialstep, run-once script, failed-build stepCompanion PRs (same branch name
feature/1355-first-session): #4736 (frontend), abilityai/trinity-enterprise#1360 (status + key check), abilityai/trinity-gateway#26 (script + website reader). There is noconnect-claudecard or change any more: Claude is connected through the shared masked credential field. Draft until reviewed; not to be merged by me. No closing keyword: the issue closes manually at release.What changes here
firstRunSteps.js/FirstRunOverlay.vue: where the instance says the assistant leads the first session, the setup dialog does not open by itself (it can still be opened), and it waits until the assistant corner is decided. Other installs are unchanged.utils/firstSession.js: the page's words for that session, its step names in one place (for journey events later; nothing is emitted), the hand-off stub for agents run elsewhere, and theCLAUDE_SIGN_INseam (null today).first_session: trueuntil the first result is seen. Claude is connected through the shared credential field (docs(#945): correct actor-model postcard — result-reporting + taxonomy/citation accuracy #1358) forANTHROPIC_API_KEY: the value is saved on this instance and never part of a message. The line the assistant gets back says only provided / not provided, plus "Anthropic did not accept it" when the instance's own check says so. A finished run carries "Open the result", and the first one opens by itself.552bd6a→4766764(abilityai/trinity-enterprise#1360's head). That commit already contains636c6d5, so this overlaps chore(enterprise): bump submodule pin to 636c6d5 — assistant credential routes (trinity-enterprise#1358) #4744 (552bd6a→636c6d5) on the same gitlink line, as a superset. Whichever lands second takes4766764.The opening placeholder and the retry error
The validation noted that the
!store.statusErrorguard was gone from the opening placeholder. The retry error renders only while there is no status (the branch beside the conversation), so the placeholder cannot pulse under it. Putting the old guard back would blank the panel when a settle re-read fails with the status already on screen. So this is pinned with a test instead of restoring the guard. A template comment says why.Tests
firstRunSteps.spec.js(+4),firstRunOverlayAssistantLeads.mount.spec.js(4, mounted),assistantWidget.mount.spec.js(+12, including "a failed first read shows the retry error alone: no loading placeholder pulses under it"; it goes red when a loading skeleton renders under the error),firstSessionExamples.spec.js(5),dashboardHidesExamples.mount.spec.js.🤖 Generated with Claude Code