[codex] hard cutover full replay telemetry for future sessions#132
[codex] hard cutover full replay telemetry for future sessions#132
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Follow-up update (reducibility pass) is now pushed:
Implemented:
Parity fixes from reviewer findings:
Validation rerun:
Independent reviewers (2 lanes) final pass: no findings. |
|
Latest incremental update pushed in What changed:
Validation rerun:
Fresh artifacts:
Note:
|
81b382c to
2542ed8
Compare
|
Follow-up fix wave pushed ( What changed:
Validation rerun:
All passed locally. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a66aee89e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const token = normalizeOptional(process.env.AGENT_TELEMETRY_INGEST_TOKEN); | ||
| const bearer = readBearer(req); | ||
| if (token && bearer === token) return true; | ||
| if (token && bearer && bearer !== token) return false; |
There was a problem hiding this comment.
Accept Supabase bearer auth when ingest token is configured
The authorization gate returns false as soon as a bearer token is present but does not equal AGENT_TELEMETRY_INGEST_TOKEN, which prevents resolveRequestUser from running. Since resolveRequestUser explicitly supports authenticating normal Supabase user bearer tokens, authenticated clients that send their user JWT in Authorization (instead of cookie auth) will now get 401 whenever an ingest token is set, breaking the intended "ingest token OR authenticated user" behavior.
Useful? React with 👍 / 👎.
Summary
Implements a hard-cutover replay telemetry pipeline for future sessions so each model/tool turn is durably replayable by correlation keys and rendered in a session-scoped HTML report with collapsible inputs/outputs.
Issue / User Impact
The current observability path stored lifecycle snapshots but not full turn-level model/tool payloads, so the requested per-model/per-agent forensic replay could not be generated for existing sessions.
Root Cause
Why This Fix Solves Root Cause
agent_model_io,agent_tool_io) plus raw blob store (agent_io_blobs) with 90-day retention columns.trace_id,request_id,intent_id,tool_call_id) and provider identity across pipeline boundaries.Changes By Surface
Schema / Contracts
docs/migrations/012_agent_replay_full_telemetry.sqlagent_model_io,agent_tool_io,agent_io_blobsagent_trace_events: provider/model/provider_source/provider_path/provider_request_idagent_tasks: trace_idtask_idstored astextfor compatibility with mixed correlation IDs.Runtime Ingestion / Emission
src/lib/agents/shared/replay-telemetry.tsupsert(..., ignoreDuplicates)to avoid partial-batch retry wedges.src/app/api/agent/telemetry/route.ts202when enqueue is dropped instead of false200success.Agent Instrumentation
src/lib/agents/realtime/voice-agent.tssrc/lib/agents/realtime/voice-agent/tool-publishing.tssrc/lib/agents/conductor/router.tssrc/lib/agents/conductor/worker.tssrc/lib/fairy-intent/router.tssrc/lib/agents/canvas-agent/server/runner.tssrc/lib/agents/subagents/crowd-pulse-steward-fast.tssrc/lib/agents/subagents/summary-steward-fast.tssrc/lib/agents/subagents/debate-steward-fast.tsReporting / Ops
scripts/observability/generate-session-chat-report.tsscripts/admin/purge-replay-telemetry.tsAdditional hardening updates in latest commits
actions) +actionCountin fairy quick task outputs:src/lib/agents/subagents/canvas-steward.tssrc/lib/agents/conductor/worker.tssrc/lib/agents/shared/replay-telemetry.ts--session-idas UUIDscripts/observability/generate-session-chat-report.tsBackward Compatibility
Validation
Automated checks
npm test -- src/lib/agents/subagents/canvas-steward.test.tsnpm test -- src/lib/agents/conductor/__tests__/router-execute-task.test.tsnpm run typecheck:agentSmoke/report evidence (latest)
/Users/bsteinher/PRESENT/reports/showcase/api-smoke-1772084062725/result.jsonactionCount=5,actionArrayLength=5, terminalsucceeded/Users/bsteinher/PRESENT/reports/agent-chat/agent-chat-report-b3ea94cc-15cb-4de0-a443-be10d55920d3.html/Users/bsteinher/PRESENT/reports/agent-chat/agent-chat-report-b3ea94cc-15cb-4de0-a443-be10d55920d3.json/Users/bsteinher/PRESENT/reports/agent-chat/webm/48b64abf966234713a7bf1897d7badad.webm/Users/bsteinher/PRESENT/reports/agent-chat/webm/agent-chat-report-b3ea94cc-15cb-4de0-a443-be10d55920d3.pngHistorical report artifact (expected pre-cutover gap)
/Users/bsteinher/PRESENT/reports/agent-chat/agent-chat-report-6267d849-1696-4c12-8a01-1c0bc6dcf2f3.html/Users/bsteinher/PRESENT/reports/agent-chat/agent-chat-report-6267d849-1696-4c12-8a01-1c0bc6dcf2f3.jsonIndependent Reviewer Lanes
replay-telemetry.ts,generate-session-chat-report.ts,canvas-steward.ts,worker.ts) with no additional blocking findings.Remaining Risk