Skip to content

feat(secrets): /secform works for a bot of another computer - #2543

Merged
TheAnimatrix merged 1 commit into
masterfrom
secform-remote-bot
Dec 1, 2026
Merged

TheAnimatrix merged 1 commit into
masterfrom
secform-remote-bot

Conversation

@TheAnimatrix

@TheAnimatrix TheAnimatrix commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

/secform in the chat of a bot that lives on another of your computers only said "Share secrets with this bot in its chat on for now". No form opened, and the chat showed no chips for what was shared.

Change

  • A bot's chat opens the form for a bot of another computer too. The form says "Stored on ". Save securely sends the values once, over the encrypted link between the computers, to that computer's secret store, for the bot alone. That computer posts the chip's line in the bot's chat, and the bot gets the names with its next turn, as for a bot here.
  • Three bot methods do this: bots.secrets.share, bots.secrets.list and bots.secrets.revoke (level Use). Only a person at a Mousse window may call them. Here, the window rule refuses the command line, agents and calls that came through another device. On the bot's computer, the call must carry the router's person mark (window: person), which the router adds for a window's call only.
  • The values travel in their own values key, apart from the names. The bot rows now say which keys hold secret values (secret), and those keys are left out of what the request ledger matches a retry on, so the ledger keeps not even a hash of a value. No reply, chat line or refusal holds a value.
  • The chips for a bot of another computer are read from that computer, and read again when a new chip line arrives or the computer comes back. When it is offline the chips stay as they were, and the form does not open.
  • The routed secrets.share, secrets.shares.revoke (work) and secrets.shares.list (view) rows from feat(secrets): /secform shares named secrets with a thread or bot, with expiry, single use and a revocable chip #2539 now have their access classes. They counted as work before, so threads behaved the same; the list is now view.
  • docs/bots.md: the /secform paragraph describes the bot methods and drops "A bot of another computer is not offered the form yet".

Verification

Tier 5 (secrets crossing between computers). node scripts/verify.mjs <files> --typecheck all passed on the published commit: 17 files, 644 tests, and both typechecks.

  • tests/bots/botSecretShares.test.ts (new):
    • a window here keeps each value for the bot's chat, posts the chip line with names only, and lists and revokes it;
    • the CLI, agents, MCP and calls that came through another device are refused;
    • a refusal never repeats a value;
    • another computer's call is kept here with the person mark and refused without it;
    • the ledger match drops values and keeps the rest;
    • the router sends a window's call marked as a person's, and a CLI call without the mark, even when the caller sets one.
  • tests/renderer/botChatView.test.ts: in the chat of a bot of another computer, /secform for api key opens the form with "Stored on Laptop". Save sends the value once by the bot's qualified id. The chip shows, and Revoke revokes it there.
  • Updated tables: botMethodTable, remote/bots, remote/botDeviceAccess.
  • Also run: botSystemInstructions, botsProtocolV2, botLocalServers, botMessagesElsewhere, netEngine/allowlist, netEngine/checks/botRouter, appSessionVectors, routed/accessClasses, secrets/secretShares, secrets/secformWiring, botCommands, secformCard.
  • Two tests already failed on master at 4a185af: routed/accessClasses (the unclassed secrets.* rows) and the bot chat's / command count, which is 11 since /secform. Both are fixed here. botDeviceAccess was missing params for bots.sandbox.forward; that row is added.
  • Not checked: a real share between two computers in the running app, and before/after screenshots of the form.

Notes

Refs #595

Summary by CodeRabbit

  • New Features
    • Use /secform to share secrets with a reachable bot on another computer. Values are stored on that computer, and you can view or revoke shares.
    • Secret-share details show field names without displaying the secret values.
  • Bug Fixes
    • Existing secret shares remain visible if a refresh fails.
    • Forms for offline bots now explain that sharing is available when the bot reconnects.
  • Documentation
    • Updated the /secform guide to cover sharing with bots on another computer.

…es go over the encrypted link to its secret store
@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

Changes: Remote bot secret sharing

Layer / File(s) Summary
Secret-share method contracts
src/shared/bots/personal/methodTable.ts, src/shared/bots/personal/methods.ts, src/shared/net/accessClasses.ts, tests/bots/botMethodTable.test.ts
Adds share, list, and revoke method definitions, access classes, and request-ledger handling metadata.
Bot secret storage and local dispatch
src/mms/MmsProfileServices.ts, src/mms/bots/chat/BotChatService.ts, src/mms/bots/registerMethods.ts, tests/bots/botSecretShares.test.ts
Connects bot methods to the secret-share store. Validates local requests and implements sharing, listing, and revocation. Tests cover storage, visibility, and caller restrictions.
Remote authorization and dispatch
src/mms/bridge/remote/RemoteBots.ts, src/mms/bridge/routed/BotRouter.ts, tests/bots/botSecretShares.test.ts, tests/net/bridge/remote/*
Validates person-originated calls, routes the secret methods, and omits secret values from retry-ledger matching. Tests cover remote access and routing.
Renderer secret-share sources and client
src/renderer/services/personalBotsClient.ts, src/renderer/components/secrets/SecretShareChip.tsx
Adds client operations for remote shares and a source-based hook that lists and revokes shares from local or remote sources.
Remote /secform interface
src/renderer/components/bots/BotChatView.tsx, src/renderer/components/bots/runBotCommand.ts, src/renderer/components/secrets/SecretShareChip.tsx, src/renderer/services/personalBotsClient.ts, docs/bots.md, tests/renderer/*
Allows reachable remote bots to open /secform. The form names the remote computer as the storage location, and the chat displays share status and supports revocation.

Possibly related issues

Suggested reviewers: bvsr365

Change: Feature

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

@TheAnimatrix
TheAnimatrix merged commit 44c589d into master Dec 1, 2026
10 of 12 checks passed
@TheAnimatrix
TheAnimatrix deleted the secform-remote-bot branch December 1, 2026 10:16
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.

1 participant