Skip to content

[1915 by GPT-5.6 Sol] Normalize Codex database fallback events to canonical live-details output - #1916

Merged
integry merged 2 commits into
mainfrom
1915/gpt-5.6-sol-normalize-codex-database--20260815-1028-tqg
Aug 15, 2026
Merged

integry merged 2 commits into
mainfrom
1915/gpt-5.6-sol-normalize-codex-database--20260815-1028-tqg

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #1915

Branch: 1915/gpt-5.6-sol-normalize-codex-database--20260815-1028-tqg
Commits: ✅ Changes committed (c628c1c)


AI Processing Completed

Execution Details:

Summary:
Implemented the Codex DB fallback normalization for issue #1915.

  • Stateful pairing of item.started/item.completed commands prevents duplicate tool uses.
  • Unmatched completions safely recover a tool use and result.
  • Codex lifecycle envelopes are ignored instead of rendered as thoughts.
  • Reasoning, agent messages, errors, todos, ordering, timestamps, token usage, and stable IDs remain preserved.
  • Stored-output parsing remains unchanged.
  • Added exact 49-event canonical parity and focused route/parser regressions.

Files:

Validation:

  • API/root lint and typecheck passed.
  • Focused live-details suite: 27 passed.
  • Redis-independent repository suite: 292 files passed.
  • UI suite: 46 files / 369 tests passed.
  • Full suite’s existing llmMetrics.test.ts could not run because this environment has no Redis server; it was the only infrastructure-blocked test.

Detailed Logs:

  • Conversation: 89 messages
  • Session: 01a004f8-6271-7080-9eeb-d07cef5faf31

Log files stored at:

  • conversation: /tmp/claude-logs/issue-1915-2026-08-15T10-49-27-954Z-conversation.json
  • output: /tmp/claude-logs/issue-1915-2026-08-15T10-49-27-954Z-output.txt
Latest Conversation Messages

This PR was created automatically by ProPR after processing issue #1915.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…ts to canoni

Implemented by ProPR AI using gpt-5.6-sol model.

Implementation completed successfully.
@integry

integry commented Aug 15, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-5.6-sol

Overall Evaluation

The PR is close, but needs a minor correction before merge: the DB fallback still renders one recognized Codex protocol event differently from the canonical parser.

✅ Correct command pairing — Started commands are tracked by stable item ID or command text, while unmatched completions recover both the tool use and result.

✅ Strong regression coverage — Tests verify the target 49-event parity, lifecycle filtering, todos, errors, token usage, ordering, and stable route IDs.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Final result envelopes leak as thoughts

  • Required behavior: The database fallback must match canonical stored-output semantics and must not render raw Codex protocol envelopes as user-visible thoughts.
  • Evidence: packages/api/routes/liveDetailsExecutionParser.ts:23 — CODEX_LIFECYCLE_EVENT_TYPES omits the recognized Codex result event. Its metadata is therefore unhandled, and the persisted JSON content reaches appendFallbackContentEvent, whereas the canonical parser ignores result conversation events.
  • Minimum fix: Treat metadata with type: 'result' as handled without emitting an event, such as by adding result to the ignored Codex protocol-event set.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Share Codex event classification

Consider centralizing the recognized Codex event vocabulary used by stored-output detection and DB normalization. The separate sets have already drifted around result and thread.started; sharing the classification would reduce future parity regressions. This is optional because the current defect has a localized correction.

Score

The implementation is focused and well tested, but the remaining canonical-parity gap is a merge blocker. The current full-suite check is also still pending, though no current check has failed.

Score: 6/10


🤖 Review Details

  • Model: GPT-5.6 Sol
  • Time: 2m 29s
  • Tokens: 40,113 (33,562 in / 6,551 out)
  • Cost: $0.32

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@integry

integry commented Aug 15, 2026

Copy link
Copy Markdown
Owner

The 49-event normalization is correct and all scope/tests are otherwise clean. One narrow regression remains in appendRawEventByType: the old error path used rawEvent.message || rawEvent.result || row.content || 'Execution error', but the PR removed row.content when it removed the row parameter. A persisted error/tool-result row can have minimal metadata ({"type":"error"} or {"type":"tool_result"}) while the actual diagnostic remains in row.content; this head would replace it with the generic fallback.

Please make only this correction with Codex:

  • Pass the row content (or an equivalent explicit fallback string) into appendRawEventByType.
  • For both error and tool_result, preserve precedence of structured metadata text, then nonempty row.content, then the generic fallback.
  • Add focused regressions for minimal error and tool-result metadata retaining the row content and error flag.
  • Preserve every other parser behavior and the exact 49-event parity fixture.

Run the focused live-details tests, API/root typecheck and strict lint, and diff-check. Do not touch deployment, UI, stored-output parsing, queues, Redis, workers, schema, or unrelated files.

@propr-dev

propr-dev Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 7e28dbc

Summary of Changes

Implemented the narrow regression fix only.

  • Restored row.content fallback for error and tool_result.
  • Preserved metadata-text → row-content → generic fallback precedence.
  • Preserved row.is_error for minimal tool-result metadata.
  • Added focused regressions for both minimal metadata cases.
  • Kept the exact 49-event parity fixture unchanged.

Validation passed:

  • Focused live-details tests: 22/22
  • API typecheck
  • Root typecheck
  • API strict lint (--max-warnings=0)
  • git diff --check

Only the requested parser and focused tests were modified. No commit created.


🤖 Implementation Details

  • Model: GPT-5.6 Sol (high)
  • Requested By: @integry
  • Time: 3m 35s
  • Tokens: 461,282 (455,897 in / 5,385 out)
  • Cost: $0.62

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Implement fixes for issues found by /review /fix or /fix address the null check issue
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 5301962991✓

Implemented the narrow regression fix only.

- Restored `row.content` fallback for `error` and `tool_result`.
- Preserved metadata-text → row-content → generic fallback precedence.
- Preserved `row.is_error` for minimal tool-result metadata.
- Added focused regressions for both minimal metadata cases.
- Kept the exact 49-event parity fixture unchanged.

Validation passed:

- Focused live-details tests: 22/22
- API typecheck
- Root typecheck
- API strict lint (`--max-warnings=0`)
- `git diff --check`

Only the requested [parser](</tmp/git-processor/worktrees/integry/propr/pr-1916-followup-2026-08-15T11-12-31/packages/api/routes/liveDetailsExecutionParser.ts>) and [focused tests](</tmp/git-processor/worktrees/integry/propr/pr-1916-followup-2026-08-15T11-12-31/packages/api/test/liveDetailsCodexDbFallback.test.ts>) were modified. No commit created.

PR: #1916
Comment by: @integry (ID: 5301962991)
Model: gpt-5.6-sol
@integry

integry commented Aug 15, 2026

Copy link
Copy Markdown
Owner

/review codex-gpt55

@propr-dev

propr-dev Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex-gpt55

Overall Evaluation

The PR is ready to merge. It brings the database fallback much closer to the canonical Codex stored-output normalization and includes focused regressions for the previously identified row-content fallback issue.

✅ Canonical event parity — The new parser tracks command starts and completions, suppresses Codex lifecycle envelopes, and the added parity test asserts the expected 49 events.

✅ Error fallback restored — appendRawEventByType now preserves structured metadata text first, then row.content, for both error and tool_result.

✅ Route-level coverage — The database fallback route test verifies stable event IDs and token usage, not just parser-local behavior.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

No suggestions.

Score

The PR satisfies the original objective, fixes the narrow regression noted in the review history, and current head checks are all passing. The added tests cover the critical normalization and fallback cases introduced by this change.
Score: 9/10


🤖 Review Details

  • Model: GPT-5.5
  • Time: 21s
  • Tokens: 33,061 (32,334 in / 727 out)
  • Cost: $0.13

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@integry
integry merged commit d537c25 into main Aug 15, 2026
13 checks passed
@integry
integry deleted the 1915/gpt-5.6-sol-normalize-codex-database--20260815-1028-tqg branch September 1, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize Codex database fallback events to canonical live-details output

1 participant