docs: update pairing docs with SQLite persistence and TUI execution details

This commit is contained in:
William Valentin
2026-02-09 22:09:30 -08:00
parent 99b7e743f4
commit bab3f26ef6
5 changed files with 14 additions and 11 deletions
+4 -5
View File
@@ -43,11 +43,10 @@
- Impact: Users cannot cancel long-running agent tasks. The "cancel" API endpoint exists but is a no-op beyond setting a flag. This affects gateway/TUI UX.
- Fix approach: Pass an `AbortSignal` into `NativeAgent.run()`. Check `signal.aborted` between loop iterations and before each tool execution. Propagate signal to model client `chat()` calls.
**PairingManager State is Ephemeral:**
- Issue: `PairingManager` stores approved senders and pending codes in memory-only Maps (`src/channels/pairing.ts:36-37`). All pairing state is lost on daemon restart.
- Files: `src/channels/pairing.ts:36-37`
- Impact: After restart, all previously paired senders must re-pair. In production, this means users lose access on every deployment or crash.
- Fix approach: Persist approved senders to SQLite (alongside sessions). Pending codes can remain in-memory since they're short-lived by design.
**PairingManager State is Ephemeral:** *RESOLVED*
- Resolution: `PairingStore` interface added to `PairingManager` with SQLite implementation via `SessionStore.getPairingStore()`. Approved senders are persisted in the `pairing_approved` table and survive daemon restarts. Pending codes remain in-memory (short-lived by design).
- Commits: `1e1a689`, `ecd3aca`, `62331c3`
- Files: `src/channels/pairing.ts`, `src/session/store.ts`, `src/daemon/services.ts`, `src/daemon/index.ts`
**Hardcoded Anthropic → GitHub Model Mapping:**
- Issue: `anthropicToGitHubModel()` contains a hardcoded mapping table that must be manually updated for each new Anthropic model release. A generic fallback regex exists but only handles the date-suffix stripping pattern.
+3 -1
View File
@@ -161,10 +161,12 @@ All adapters implement `ChannelAdapter` interface (`src/channels/types.ts`): `co
- Gateway lock: Single-client WebSocket mode (`server.lock`)
**DM Pairing Codes:**
- Implementation: `src/channels/pairing.ts`
- Implementation: `src/channels/pairing.ts`, `src/session/store.ts` (SQLite persistence)
- Purpose: Authenticate unknown senders via one-time codes
- Config: `pairing.enabled`, `pairing.code_ttl` (default 5m), `pairing.code_length` (default 6)
- Gateway handlers for code generation/verification
- TUI `/pair` command execution (generate/list/revoke) in `src/frontends/tui/minimal.ts`
- Persistence: `PairingStore` interface with SQLite `pairing_approved` table -- approved senders survive daemon restarts
**Gmail OAuth2:**
- SDK: `googleapis` (`src/automation/gmail.ts`)