Skip to content

feat(mcp): read back thread pin, archive and auto-settle state - #15

Merged
samnab merged 1 commit into
devfrom
feature/api-14-organization-readback
Oct 29, 2026
Merged

samnab merged 1 commit into
devfrom
feature/api-14-organization-readback

Conversation

@samnab

@samnab samnab commented Oct 29, 2026

Copy link
Copy Markdown
Owner

MCP agents could pin, snooze, settle and archive threads but could not read back pin or auto-settle state, and had no way to find archived threads.

  • t3_thread_list items gain pinned, archived and autoSettle; t3_thread_read detail gains pinned and autoSettle.
  • t3_thread_list accepts archived: true to list archived threads (existing getShellSnapshot({ location: "archive" }) path). Default stays active threads; the other listProjectThreads caller is unchanged.
  • Reorder is intentionally out: the pinned block merges environments, so one server cannot compute a correct order.

Tool list: 61,993 → 62,116 bytes (ceiling 65,366). Gate: 322 tests across the budget, MCP service, thread handler, ThreadManagementService and ClaudeAdapterV2 files; server and contracts typecheck clean. Fresh Claude Opus review: APPROVE (67/67 re-run). Known limit: an older linked peer ignores archived and returns active threads; non-empty replies fail with the existing "update both environments" error, empty ones read as none.

Implemented with GLM-5.3-Flash via Pi; reviewed with Claude Opus 5.5 via Claude Code in T3 Code.

🤖 Generated with Claude Code

API-14: MCP agents can see a thread's pin, archive, and auto-settle state
and can list archived threads. t3_thread_list gains an `archived` input
that switches listProjectThreads to the archive location; list items and
thread detail now carry `pinned`, `archived`, and `autoSettle`. Read-only;
no reorder (the pinned block merges environments, so no server-side order).

Gate: 322 tests pass across AgentContextBudget, thread handlers,
OrchestratorMcpService(.activity), ThreadManagementService, and the
ClaudeAdapterV2 allowlist parity test; server + contracts typecheck clean;
mcpToolListJsonBytes 62116 (ceiling 65366).
@samnab
samnab merged commit 727d584 into dev Oct 29, 2026
4 of 15 checks passed
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S labels Oct 29, 2026
samnab added a commit that referenced this pull request Nov 1, 2026
Brings fork PRs #15-#26 (MCP read-back and agent tooling) onto dev,
which already carries upstream 15fe283.

Resolutions:
- ThreadManagementService: list archived threads (origin) and keep the
  side-chat / isListedThreadLineage filter (upstream).
- PeerMcpClient: keep undeclared-argument preflight via startSession
  (origin) and store the session before the first call so it outlives a
  waiting or cancelled request (upstream pingdotgg#26567); statusFailure covers
  401/403/other.
- PeerMcpClient.test (add/add): both suites kept; upstream's scripted
  renew test now accounts for the tools/list discovery request.
- PeerForwarding.test, linkOrigin.test: both new mocks kept, grouped in
  one Layer.mergeAll to stay within pipe's 20-argument limit.
- OrchestratorMcpService.activity.test: Effect.succeedSome per upstream
  lint rule.
- agentContextBudget.json: measured values after merge.
- No migrations added by origin/dev; no references to renamed symbols.

Checks: vp run typecheck clean in apps/server, packages/contracts,
packages/shared, packages/client-runtime, apps/web, apps/mobile.
vp test run ThreadManagementService.test, src/mcp, src/peer,
src/persistence, AgentContextBudget.test: 67 files, 570 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant