Repository navigation
fix(core): ship safe failure diagnostics and manual continuation via beta - #26
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86304f3ca3
ℹ️ 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".
| result.Buckets[buckets[row.BucketNumber]] = &row.P95Ms | ||
| } | ||
| } | ||
| terminal, err := tx.Query(ctx, `SELECT status, outcome->>'error_code', outcome->>'engine_error_code', outcome->'engine_http_status', count(*) FROM turns WHERE completed_at >= $1 AND completed_at < $2 AND status IN ('completed','failed','cancelled') GROUP BY 1,2,3,4`, start, end) |
There was a problem hiding this comment.
Index the terminal-turn time range before querying it
On deployments with substantial retained Turn history, every Core metrics read will sequentially scan the entire turns table because no migration indexes terminal rows by completed_at: 000068_core_metrics_indexes.sql only provides a started_at index and an execution_interrupted-specific partial index that cannot satisfy this predicate. Since Sessions deleted from public access retain their Turns and the metrics service gives the whole history read a three-second budget, this new query will eventually time out, make terminal_turns null, and mark the service degraded; add an appropriate bounded/partial completed_at index and validate the query against representative history volume.
AGENTS.md reference: AGENTS.md:L17-L17
Useful? React with 👍 / 👎.
Project applications can now inspect safe failure categories and determine whether a failed Session accepts a new manual Turn. Runtime billing failures preserve HTTP 402 as a typed category; Core administration clients and Web explain this category without native error text. Diagnostics reads create no Turns, and successful manual continuation preserves the failed Turn.
This integration preserves the current beta architecture while merging a production-base backport through normal merge commits. The requested production release is the ancestor
51fa68f640f7e4fb05eec6279dd521a0f2122f3d, based on deployed11956c3c78d84e3edfabf43d13bc8497f4f59c25, not this PR's beta HEAD. The release ancestor adds no migrations. Current beta already contains eight unrelated migrations that this narrow release deliberately does not deploy. The beta ledger records this source selection and the matching Runtime template requirement.Validation: focused Go/API/Runtime contracts, real local PostgreSQL failure-to-new-Turn/history/isolation/metrics regression, client and Web diagnostics tests, TypeScript, generated schemas and translations. Complete release CI is running for the fixed production ancestor; this PR also requires its integration CI. Independent review covered both adaptations and the release candidate. Production activation and actual live model execution are separate from these checks.