ubiquitous-invention/apps/mcp-server
Randall Stillwell fc2235a346 feat(agent-runs): capture client + model identity on claim/complete
Adds level-B agent attribution: every MCP tool call can identify itself
with a `client` (e.g. cursor-ide, codex, echodo-orchestrator) and `model`
(e.g. claude-4.6-sonnet) string. Both optional, both stored in
agent_runs.metadata as JSONB so the schema doesn't move.

- claim_task: new optional `client` + `model` args. Written into the
  inserted agent_runs row's metadata, and mirrored into the audit log
  entry. On idempotent re-claim, incoming values are merged into
  existing metadata (existing keys override only when explicit), so a
  mid-session model switch updates attribution without losing earlier
  context.
- complete_task: same optional args, with merge-on-close semantics —
  late-bound values override the earlier claim's values so the run row
  reflects whichever model actually closed the session. Audit row also
  carries the merged identity.
- /settings/runs UI: stack the client/model under the actor name in the
  table so attribution is visible at a glance without adding a column.

Smoke-tested: claim with {cursor-ide, claude-4.6-sonnet} then complete
with only model={claude-4.6-sonnet-medium-thinking} yields final
metadata {client: cursor-ide, model: claude-4.6-sonnet-medium-thinking}
on both the run row and the task.completed audit entry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 10:11:35 -05:00
..
src feat(agent-runs): capture client + model identity on claim/complete 2026-06-03 10:11:35 -05:00
package.json chore(agent-coordination): wire Cursor MCP + one-shot importer for dogfooding 2026-06-03 08:57:21 -05:00
tsconfig.json chore(lint+types): green pnpm lint && pnpm type-check from a clean clone 2026-06-02 00:11:52 -05:00
tsup.config.ts collab/mcp: bundle workspace deps so runtime doesn't import .ts files 2026-04-27 16:47:17 -05:00