Skip to content

Revert "fix(native-chat): preserve large structured command results" - #17719

Merged
brennanb2025 merged 1 commit into
mainfrom
revert-17707-brennanb2025/fix-native-chat-large-results
Aug 31, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
revert-17707-brennanb2025/fix-native-chat-large-results

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 40 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​912 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6920 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6008
Prod 102 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1499 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7516 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6017

Reverts #17707

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown

Too many files changed for review (142 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@brennanb2025
brennanb2025 merged commit 894ed75 into main Aug 31, 2026
10 checks passed
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: db8dbf00-8e50-4343-9ecb-6bbb75c79633

📥 Commits

Reviewing files that changed from the base of the PR and between 5fe3772 and 1272ee8.

📒 Files selected for processing (142)
  • docs/native-chat-large-result-electron-evidence.md
  • docs/native-chat-large-result-plan.md
  • src/main/codex/codex-app-server-connection-types.ts
  • src/main/codex/codex-app-server-connection.test.ts
  • src/main/codex/codex-app-server-connection.ts
  • src/main/codex/codex-app-server-frame-size-error.ts
  • src/main/codex/codex-app-server-record-dispatch.ts
  • src/main/codex/codex-app-server-record-prefix.ts
  • src/main/codex/codex-app-server-record-reader.ts
  • src/main/codex/codex-prompt-registry-bounds.ts
  • src/main/codex/codex-server-request-disposition.test.ts
  • src/main/codex/codex-server-request-disposition.ts
  • src/main/codex/codex-structured-acquisition-window.ts
  • src/main/codex/codex-structured-item-stream-bounds.ts
  • src/main/codex/codex-structured-item-stream-contracts.ts
  • src/main/codex/codex-structured-item-stream-events.ts
  • src/main/codex/codex-structured-item-streams.ts
  • src/main/codex/codex-structured-item-translation.test.ts
  • src/main/codex/codex-structured-item-translation.ts
  • src/main/codex/codex-structured-journal-contracts.ts
  • src/main/codex/codex-structured-journal-generic-frames.ts
  • src/main/codex/codex-structured-journal-items.ts
  • src/main/codex/codex-structured-journal-limits.ts
  • src/main/codex/codex-structured-journal-prompts.ts
  • src/main/codex/codex-structured-journal-settlement.ts
  • src/main/codex/codex-structured-journal-sink.ts
  • src/main/codex/codex-structured-journal-translation-restore.ts
  • src/main/codex/codex-structured-journal-translation-settlement.test.ts
  • src/main/codex/codex-structured-journal-translation-streams.test.ts
  • src/main/codex/codex-structured-journal-translation-turn-state.test.ts
  • src/main/codex/codex-structured-journal-translation-turn-state.ts
  • src/main/codex/codex-structured-journal-translation-turns.ts
  • src/main/codex/codex-structured-journal-translation-values.ts
  • src/main/codex/codex-structured-journal-translation.test.ts
  • src/main/codex/codex-structured-journal-translation.ts
  • src/main/codex/codex-structured-notification-retry.ts
  • src/main/codex/codex-structured-prompt-items.test.ts
  • src/main/codex/codex-structured-prompt-items.ts
  • src/main/codex/codex-structured-prompt-replies.test.ts
  • src/main/codex/codex-structured-prompt-replies.ts
  • src/main/codex/codex-structured-provider-events.ts
  • src/main/codex/codex-structured-session-acquire.ts
  • src/main/codex/codex-structured-session-adapter-lifecycle.test.ts
  • src/main/codex/codex-structured-session-adapter.test.ts
  • src/main/codex/codex-structured-session-adapter.ts
  • src/main/codex/codex-structured-session-close.test.ts
  • src/main/codex/codex-structured-session-close.ts
  • src/main/codex/codex-structured-session-options.test.ts
  • src/main/codex/codex-structured-session-state.ts
  • src/main/codex/codex-structured-thread-open.test.ts
  • src/main/codex/codex-structured-thread-open.ts
  • src/main/codex/codex-turn-ordinals.ts
  • src/main/daemon/ndjson.test.ts
  • src/main/daemon/ndjson.ts
  • src/main/native-chat/agent-session-journal/journal-blob-store.ts
  • src/main/native-chat/agent-session-journal/journal-compaction.ts
  • src/main/native-chat/agent-session-journal/journal-corruption-quarantine.ts
  • src/main/native-chat/agent-session-journal/journal-epoch-controller.ts
  • src/main/native-chat/agent-session-journal/journal-epoch-replacement.test.ts
  • src/main/native-chat/agent-session-journal/journal-epoch-replacement.ts
  • src/main/native-chat/agent-session-journal/journal-epoch-rollover.ts
  • src/main/native-chat/agent-session-journal/journal-item-appender.ts
  • src/main/native-chat/agent-session-journal/journal-legacy-import.test.ts
  • src/main/native-chat/agent-session-journal/journal-legacy-import.ts
  • src/main/native-chat/agent-session-journal/journal-lifecycle-admission.ts
  • src/main/native-chat/agent-session-journal/journal-lifecycle-batch-appender.ts
  • src/main/native-chat/agent-session-journal/journal-lifecycle-batch-partition.ts
  • src/main/native-chat/agent-session-journal/journal-lifecycle-capacity.test.ts
  • src/main/native-chat/agent-session-journal/journal-lifecycle-capacity.ts
  • src/main/native-chat/agent-session-journal/journal-log-file.ts
  • src/main/native-chat/agent-session-journal/journal-open.ts
  • src/main/native-chat/agent-session-journal/journal-payload-bounds.ts
  • src/main/native-chat/agent-session-journal/journal-physical-quota.test.ts
  • src/main/native-chat/agent-session-journal/journal-physical-quota.ts
  • src/main/native-chat/agent-session-journal/journal-prompt-body-bounds.ts
  • src/main/native-chat/agent-session-journal/journal-reducer.test.ts
  • src/main/native-chat/agent-session-journal/journal-reducer.ts
  • src/main/native-chat/agent-session-journal/journal-row-builders.ts
  • src/main/native-chat/agent-session-journal/journal-row-schema.test.ts
  • src/main/native-chat/agent-session-journal/journal-row-schema.ts
  • src/main/native-chat/agent-session-journal/journal-row-writer-read-only-latch.test.ts
  • src/main/native-chat/agent-session-journal/journal-row-writer.ts
  • src/main/native-chat/agent-session-journal/journal-store-contracts.ts
  • src/main/native-chat/agent-session-journal/journal-store-factory.ts
  • src/main/native-chat/agent-session-journal/journal-store-open.ts
  • src/main/native-chat/agent-session-journal/journal-store-schema.test.ts
  • src/main/native-chat/agent-session-journal/journal-store.test.ts
  • src/main/native-chat/agent-session-journal/journal-store.ts
  • src/main/native-chat/agent-session-journal/journal-tool-output-fallback.ts
  • src/main/native-chat/agent-session-journal/journal-write-guards.ts
  • src/main/native-chat/agent-session-wire/agent-session-delta-coalescer.test.ts
  • src/main/native-chat/agent-session-wire/agent-session-delta-coalescer.ts
  • src/main/native-chat/agent-session-wire/agent-session-history-page-bounds.ts
  • src/main/native-chat/agent-session-wire/agent-session-history-page.test.ts
  • src/main/native-chat/agent-session-wire/agent-session-history-page.ts
  • src/main/native-chat/agent-session-wire/agent-session-journal-batch.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-adapter.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-attach-context.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-attach-flow.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-attach-orchestration.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-event-recovery.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-event-sink-estimate.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-event-sink-queue.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-event-sink.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-event-sink.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-eviction.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-eviction.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-handoff.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-holders.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-holds.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-holds.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host-handoff.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host-handoff.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host-runtime-state.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host-runtime-state.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host-types.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-lease-release.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-read-restore.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-refusal-message.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-settlement-retry.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-surface-lifetime.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-turns-options.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-turns-prompt.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-turns.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-turns.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-unexpected-exit.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-unexpected-exit.ts
  • src/main/native-chat/agent-session-wire/structured-tui-transcript-catchup.test.ts
  • src/main/native-chat/agent-session-wire/unhandled-provider-frame.ts
  • src/main/runtime/agent-session-lease-transitions.ts
  • src/main/runtime/agent-session-surface-release-transition.ts
  • src/main/runtime/structured-agent-session-integration-replay.test.ts
  • src/main/runtime/structured-agent-session-integration.test.ts
  • src/main/runtime/structured-agent-session-runtime-exit.test.ts
  • src/main/runtime/structured-agent-session-runtime.ts
  • src/shared/agent-session-journal-types.ts
  • src/shared/agent-session-lease-adjudication.ts
  • src/shared/agent-session-record.ts
  • src/shared/main-process-ndjson-framer.ts

📝 Walkthrough

Walkthrough

The change consolidates Codex connection, translation, prompt, and session lifecycle logic. It removes admission, backpressure, physical-quota, lifecycle-batch, and unexpected-exit recovery paths. The journal store and deferred event sink now use direct row persistence and promise-chain delivery. NDJSON parsing is defined locally. Journal schema handling adds corruption, malformed-row, torn-tail, and newer-schema recovery coverage. Prompt and stream payload limits are reduced or removed in several paths. Session acquisition and attachment no longer propagate acquisition generations.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

This is a faithful, byte-identical revert of #17707 that restores the pre-fix tree — but it carries no rationale and reintroduces a known user-facing bug.

Reviewed changes

This PR reverts fix(native-chat): preserve large structured command results (#17707), restoring the codebase to the exact state of commit 68de1be517.

  • Restores the 1 MiB provider-kill cutoff — removes the incremental 16 MiB NDJSON framer (main-process-ndjson-framer.ts) and the pauseReading/resumeReading backpressure hooks, reverting codex-app-server-connection.ts to STDOUT_LINE_MAX_BYTES = 1024 * 1024 and its "ends the connection rather than buffering an oversized line" behavior.
  • Removes durable journal machinery — drops the blob store, physical-quota accounting, lifecycle batch/capacity/admission, event-sink queue and recovery, and unexpected-exit host lifecycle handling.
  • Drops the journal schema version from 2 to 1 — removes the lifecycle-batch row kind and its parser branch from journal-row-schema.ts.
  • Removes the settlementRetry* lease fields — deleting the recovering restart disposition from agent-session-lease-adjudication.ts.
  • Deletes the plan/evidence docs (native-chat-large-result-plan.md, native-chat-large-result-electron-evidence.md).

Verified: git diff --stat 68de1be517 HEAD is empty (tree is byte-identical to pre-#17707), and pnpm tc:node passes. The revert commit is consecutive with #17707 (32 seconds apart), so no release and no intermediate commit depends on the removed symbols.

⚠️ No rationale for reverting a validated fix

The PR body is the bare auto-generated "Reverts #17707". #17707 shipped user-visible Electron evidence (a 2 MiB command completing without killing the provider), ~140 focused + ~1,400 broad tests, and addressed a real failure (the provider tree is killed as soon as an unterminated line exceeds 1 MiB, which is below the protocol's real serialized envelope). Reverting it reintroduces that bug — large structured command results will again terminate the provider/session — with no record of why. If the fix regressed something in practice, that regression should be documented here so the next attempt does not repeat it.

⚠️ Persisted journal schema version downgraded without an upcaster

AGENT_SESSION_JOURNAL_SCHEMA_VERSION goes 1 -> 2 -> 1, and the lifecycle-batch row kind (plus its reader branch) is deleted. Any journal written by a schema-v2 build becomes "future schema" on this build and degrades to read-only rather than rendering. In practice no release shipped v2 (merge-to-revert was 32 seconds), so this is currently theoretical — but a persisted-schema version should be monotonic, so please confirm no v2 build reached users before this lands.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant