Repository navigation
feat(assistant): a masked credential field in the assistant panel (abilityai/trinity-enterprise#1358) - #4741
Conversation
…ilityai/trinity-enterprise#1358) When the assistant asks for a credential by name, the panel shows a `credential` card: a masked field with Show/Hide, Save and Cancel, the assistant's reason quoted, and in plain words that the assistant cannot see what is typed and where the value is stored. It reads whether the name is set already and says when Save replaces it; the current value is never shown. Save empties the field, posts the value once to the instance (POST /api/enterprise/assistant/credential) and then sends the assistant only "Provided: NAME for the agent X." (uncounted). Cancel sends "Not provided: ..." and stores nothing. A refusal is named in the field, the card stays open and nothing is sent. The card carries no value, so the conversation kept in the browser never holds one. A card is accepted only with a name, a reason and an agent the page read from the instance (or no agent, for the instance's own Claude key). Tests: assistantCredentialField.mount.spec.js (7, mounted through the real widget and store). Assistant, credential and ratchet specs: 246 passed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
/validate-pr — REQUEST CHANGES (head 9fe744c) · run K8tjqFfkK9_jLQ1ZiaZhrwValidated together with Abilityai/trinity-enterprise#1361 and Abilityai/trinity-gateway#27. Lane B. Entry point and reuse notes: both in the body ✅. Journey Impact ✅ (CI). Ratchets (raw-color, loading-gate, source-text) 28/28 ✅. CI My own probe mounts the real
Required change
Draft #4736: it can switch with no change here for the API key. Note: the body says "Part of abilityai/trinity-enterprise#1358" and has no closing keyword. I left it, since ent#1361 carries |
…the name (abilityai/trinity-enterprise#1358) The state lookup's 422 (invalid_credential_name / invalid_agent) is the instance's own policy: the card now closes with its words, shows no input and sends no turn. Any other lookup failure still opens the field. The field also waits for the lookup to answer before it shows the input. Mutation: reverting the 422 branch in credentialState turns 'a name the instance refuses closes the card…' red. Co-Authored-By: Claude Opus 5.5 <[email protected]>
/validate-pr re-validation: APPROVE (head cbec612) · run self-serve-instances / exec jD7vYKqY1dqrTPInMJ16JQThis checks the fix commit only, after K8tjqFfkK9_jLQ1ZiaZhrw. I'm not the fix run (BJ1_cDUKGlhoGsKy4Qly4w). I used my own probe, which mounts the real
CI: Tier 1 is green: CodeQL ×2, schema-parity, verify-non-root, Suggestion (non-blocking): the PR's own spec doesn't pin "no input while the lookup is pending". With |
The assistant panel gets a masked credential field. When the assistant needs a secret, it asks for it by name. The person types the value into a field the assistant cannot read, and the value goes only to this instance.
Part of abilityai/trinity-enterprise#1358 (private tracker; it is closed by hand at release). Companions: abilityai/trinity-enterprise#1361 (the routes this field calls) and abilityai/trinity-gateway#27 (the tool that raises the card).
What a person sees
NAME for <agent>(orfor this instance).What the assistant is told
Only one line, sent uncounted:
Provided: NAME for the agent X./Provided: NAME for this instance., orNot provided: …on Cancel. Nothing is sent after a refusal.Entry point (for other work that needs this field)
{ action: 'credential', name, why, agent? }.nameis UPPER_SNAKE_CASE.agentmust be an agent the page read from the instance. With noagent, the name must be inINSTANCE_CREDENTIALS(today only the instance's Claude key,ANTHROPIC_API_KEY).answerCredential(messageId, cardId, value | null, route).GET /api/enterprise/assistant/credential?name=&agent=returns set / not set / unknown.POST /api/enterprise/assistant/credential {agent|null, name, value}.Reused vs new
PortalCredentialField.vue): the same masked input, Show/Hide, empty-before-send, and clearing on unmount. It is mirrored rather than reused because that field is bound to an operator-queue ask id and its store.AssistantCredentialField.vue,validCredential/credentialLine/credentialWhereinassistantCards.js, andcredentialState/answerCredentialin the assistant store.Tests
assistantCredentialField.mount.spec.jshas 7 tests, mounted through the realAssistantWidgetand store. They show the value reaches no turn sent to the assistant, no message the panel keeps, and nolocalStorageorsessionStorage. They also cover Cancel, a named refusal, the replace notice, the instance key, and a card that carries extra fields being dropped. Mutation check: putting the value on the card entry turns the "Provided" test red.Assistant, credential and ratchet specs: 13 files, 246 passed. The full vitest run was not completed locally (it ran past the time limit); CI runs it.
Before merge
🤖 Generated with Claude Code