Skip to content

fix: validate midnight deltas following native compaction - #884

Merged
miuuyy merged 2 commits into
miuuyy:mainfrom
nofihq:fix/compaction-midnight-delta
Oct 22, 2026
Merged

miuuyy merged 2 commits into
miuuyy:mainfrom
nofihq:fix/compaction-midnight-delta

Conversation

@nofihq

@nofihq nofihq commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #883.

A native compaction continuation can contain a rebuilt full environment preamble followed by a same-turn, date-only midnight update. Both XML parts are counted as complete grants, so extractChatGptContinuationEnvironmentClaim rejects the request before the current native rollout can validate it.

Accept one rebuilt full environment followed by strictly parsed calendar fragments. Carry those fragments into the existing current-rollout root and complete filesystem-profile checks. A second full environment, changed roots/profile, malformed fields, stale/missing rollout, or incompatible network policy still fails closed. This changes no browser ownership, completion, tool approval, model, or retry behavior.

Validation:

  • Replayed both preserved actual failing native inputs read-only: released v6.1.13 throws the observed error; this patch validates both against their exact current native rollout. The issue includes redacted envelope excerpts; private requests/rollouts are not published.
  • The two new v1/v2 regression cases fail on released source and pass here. The focused environment suite passes 124 tests (one skip), including workspace-write/read-only, network on/off, conflicting grants and missing/stale authority.
  • bun run verify on this three-file change: 1,031 core tests pass (89 skips), 422 launcher tests pass (one skip), audits/typechecks and relocatable runtime smoke pass. Linux x64 packaged-launch smoke passed using an isolated application/Codex home on the existing X11 display. macOS/Windows were not tested locally.
  • Installed this scoped patch on official 6.1.13 at an atomic idle boundary. The original research sessions completed real tools/checkpoints and automatic follow-on goal turns; a later real native compaction also completed. Native desktop process and research evidence were preserved.

This PR addresses only the environment-validation failure. Live supervision also found separate intermittent Web empty-final and detached-response binding failures; those are not claimed fixed by this patch. Local diagnostic instrumentation used for that separate investigation and local package-version stamps are excluded from this PR.

@miuuyy miuuyy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks — I reproduced #883 on released 6.1.13, and this patch fixes it. There is one validation gap to close before merging: two full environment content parts in the same rebuilt message, followed by a valid midnight delta, are accepted. The later full claim is skipped because the calendar scan starts after the whole message.

In the new v1/v2 regression, append another environment content part to current.content with a different cwd, before calling store.resolve(request). Both variants currently accept it. Please require exactly one environment part in the rebuilt base message and add this rejection test. I checked that rejecting additional claims at first.index fixes this while preserving the reported midnight case.

@miuuyy miuuyy added the urgent PR: active major user-facing problem; urgency does not imply patch correctness or approval. label Oct 21, 2026
@nofihq

nofihq commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Addressed in b3040fc. Both v1/v2 regressions reproduced your reported acceptance before the correction. The parser now rejects any additional environment part at the rebuilt base message index before scanning later calendar fragments. The tests cover both a conflicting full claim and an identical duplicate in the same current.content, and still verify that the valid midnight continuation resolves afterward.

Validation on the exact PR branch: all 124 environment tests pass (one Windows-only skip); full bun run verify passes with 1,031 core tests (89 skips), 422 launcher tests (one skip), audits, typechecks and relocatable runtime smoke. Only the environment parser and its existing regression were changed in this follow-up; local browser diagnostics and version stamps remain excluded. I have not restarted the serving launcher to deploy this follow-up.

@miuuyy miuuyy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The duplicate-part regression is fixed. I reproduced the original failure and verified the valid continuation and rejection cases. Thanks for the follow-up.

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

Labels

urgent PR: active major user-facing problem; urgency does not imply patch correctness or approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 6.1.13 rejects rebuilt compaction environment followed by same-turn midnight delta

2 participants