Files
devops-engineer 59e5b20724
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
CI / Python Lint & Test (pull_request) Successful in 4s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 9s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 5s
Harness Replays / detect-changes (pull_request) Successful in 8s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 5s
E2E Chat / detect-changes (pull_request) Successful in 15s
CI / Detect changes (pull_request) Successful in 20s
E2E API Smoke Test / detect-changes (pull_request) Successful in 18s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 8s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 4s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
Harness Replays / Harness Replays (pull_request) Successful in 6s
CI / Canvas (Next.js) (pull_request) Successful in 4s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 9s
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 16s
sop-checklist / review-refire (pull_request_target) Has been skipped
E2E Chat / E2E Chat (pull_request) Successful in 13s
CI / Canvas Deploy Status (pull_request) Successful in 1s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request_target) Successful in 10s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 27s
Check migration collisions / Migration version collision check (pull_request) Successful in 46s
gate-check-v3 / gate-check (pull_request_target) Successful in 20s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 48s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 1m20s
CI / Platform (Go) (pull_request) Successful in 2m58s
CI / all-required (pull_request) Successful in 4s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 5m0s
E2E Staging External Runtime / E2E Staging External Runtime (pull_request) Successful in 5m26s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Failing after 5m52s
qa-review / approved (pull_request_target) Review check failed via pull_request_review trigger
security-review / approved (pull_request_target) Review check failed via pull_request_review trigger
qa-review / approved (pull_request_review) Failing after 16s
security-review / approved (pull_request_review) Failing after 13s
audit-force-merge / audit (pull_request_target) Successful in 13s
feat(requests): P1 — unified requests/inbox data model + endpoints (RFC)
Implements Phase 1 of the unified-requests-inbox RFC: a single `requests`
subsystem that generalizes `user_tasks` (agent→user worklist asks) and
`approval_requests` (the destructive-action gate) into one inbox keyed by
`kind ∈ {task, approval}`, where requester and recipient may each be a user
OR an agent. Responding is asynchronous — the requester never blocks; a
REQUEST_RESPONDED event signals it to pick the answer up on its next tick.

Schema (migrations/20260610120000_requests.{up,down}.sql, idempotent):
- `requests`: kind, requester_{type,id}, org_id, recipient_{type,id}, title,
  detail, status (pending|info_requested|done|rejected|approved|cancelled),
  responder_{type,id}, priority, created/updated/responded_at. recipient_id /
  requester_id are plain TEXT with NO FK (a party may be a user, not a
  workspaces row). Indexes for inbox, org-pending, and outgoing reads.
- `request_messages`: the More-Info / "chat about this" thread (FK → requests,
  ON DELETE CASCADE), indexed by (request_id, created_at).
- Idempotent backfill (ON CONFLICT (id) DO NOTHING) copies historical
  user_tasks (kind=task; dismissed→rejected) and approval_requests
  (kind=approval; denied→rejected, escalated→pending) into the unified inbox
  so the tabs show pre-cutover items.

Store (internal/handlers/request_store.go): RequestStore mirrors UserTaskStore
— per-request over global db.DB, events.EventEmitter for testability, sentinel
errors. Create / Get / Messages / ListInbox / ListOutgoing / ListPendingForOrg
(LEFT JOIN workspaces for the agent name) / Respond (validates action↔kind:
approval→approved|rejected, task→done|rejected) / RequestInfo / AddMessage
(flips info_requested when the recipient asks back) / Cancel. Mutations
broadcast REQUEST_CREATED / REQUEST_RESPONDED / REQUEST_MESSAGE anchored on the
agent party so the canvas/inbox is signalled.

Handler (internal/handlers/requests.go) + routes
(internal/router/router.go), mirroring the approvals/user-tasks auth split:
- wsAuth (workspace token): POST /workspaces/:id/requests, GET .../requests
  (outgoing), GET .../requests/inbox, plus agent-side
  .../requests/:requestId/{get,respond,messages,cancel}.
- AdminAuth (canvas user): GET /requests/pending?kind=task|approval (the tabs),
  and /requests/:requestId/{get,respond,messages,cancel}. The org_id anchor is
  resolved via orgRootID (org_scope.go) — the workspaces table has no org_id
  column.

Events (internal/events/types.go): adds REQUEST_CREATED, REQUEST_RESPONDED,
REQUEST_MESSAGE to the taxonomy + AllEventTypes; drift snapshot
(types_test.go) updated. Canvas TS mirror is a later phase (not touched here).

Tests (internal/handlers/requests_test.go): 20 cases via the existing sqlmock
harness — create (task + approval, agent recipient), inbox vs outgoing,
get+thread, respond (valid + invalid action-for-kind + not-found), More-Info
message → info_requested (recipient flips, requester doesn't), cancel, org
pending list + kind filter, recipient routing.

This is P1 of the unified-requests RFC. Follow-ons: P2 MCP tools + approval
shims, P3 canvas Tasks/Approvals tabs UI, P4 idle-nudge worker. Not included
here.

RFC: docs/design/rfc-unified-requests-inbox.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 10:23:24 +00:00
..