Skip to content

Normalize Codex database fallback events to canonical live-details output #1915

Closed

Description

@integry

Problem

The public demo copies the production SQLite rows but does not have the canonical Codex output artifact retained by the production Redis/filesystem path. For completed Codex tasks, /api/task/:taskId/live-details therefore uses parseExecutionDetailsFromDb().

On task integry-propr-1912-codex-gpt-5.6-sol-525d836e-6807-48a9-b1e4-71e116fb1f73, the canonical stored-output parser returns 49 events (5 thoughts, 22 tool uses, 22 tool results), while the DB fallback returns 88 (22 thoughts, 44 tool uses, 22 results). The extra 39 are 22 duplicated command starts plus 17 raw Codex lifecycle JSON envelopes (thread.started, turn.started, turn.completed, item.started, item.completed) rendered as thoughts.

The SQLite rows are byte-equivalent between source and demo; this is a fallback-normalization defect, not refresh row loss.

Required fix

  • Make the DB execution-detail fallback normalize Codex lifecycle rows with the same semantics as the canonical stored-output parser.
  • Pair item.started / item.completed command executions so one logical command produces one tool_use and one tool_result; retain safe recovery for an unmatched completion.
  • Render only actual reasoning/agent-message text as thoughts. Do not expose raw protocol envelopes as thought content.
  • Preserve ordering, stable event IDs, real errors, todos, and token usage.
  • Do not change the normal stored-output/conversation parsing path or unrelated task processing.

Tests

  • Synthetic Codex lifecycle fixture proving exact canonical parity: 5 thoughts + 22 tool uses + 22 results = 49, no JSON protocol envelope visible.
  • Focused paired/unmatched command, lifecycle-ignore, reasoning/message, error/todo, stable-ID and DB-fallback route regressions.
  • Existing live-details/API tests, strict lint, typecheck, and full suite must pass.

Use Codex only. Keep the PR narrowly limited to live-details parsing/tests. No deployment, queue, worker, Redis protocol, schema, migration, or UI changes.

Activity

  1. propr-dev commented on Aug 15, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using codex agent with gpt-5.6-sol model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: codex
    • Model: gpt-5.6-sol
    • Branch: 1915/gpt-5.6-sol-normalize-codex-database--20260815-1028-tqg
    • Base Branch: main
    • Worktree: issue-1915-20260815-1028-gpt-5.6-sol-tqg

    🔍 Track Task Execution

  2. added a commit that references this issue on Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions