Skip to content

🤖 refactor: skill-tool refinement rows and refine's journal reads use the session's layers - #7507

Merged
ThomasK33 merged 1 commit into
followups/lock-routingfrom
followups/journal-locks
Oct 25, 2026
Merged

ThomasK33 merged 1 commit into
followups/lock-routingfrom
followups/journal-locks

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

This PR closes the PR 12 (#7404) journal follow-ups of #7326 and mirrors #7485's createParentDir option in the foreign-holder test layer. It is stacked on PR B. App behavior does not change: in the app, the history's file and lock layers are the same objects as the Node layers, so every call still gets the same shared journal instance.

The skill tools write their refinement rows through the tool config's layers. RefineService reads its seq baseline and its staged rows through its history's layers. The skill-write config of RefineService now carries the history's session files. A test graph on memory layers therefore writes and reads one journal, the one that aiService.durableEventJournalFor uses.

Refs #7326

Items

#7326 item Result
PR 12 advisor: appendRefinementEvent writers of sharedDurableEventJournal (the skill tools) Done. RefinementEmitArgs gets layers, and appendRefinementEventFromTool passes the tool config's sessionFiles and sessionLocks. The sessionLocks field became required in PR B.
PR 12 advisor: refineService.ts:1245 reads the shared journal Done. readMaxJournalSeq and listStagedRefinementRows both read through journalLayers(), which returns the history's files and locks. listRefinements takes optional layers for this caller, so the baseline and the staged rows come from one journal. The skill-write config of RefineService sets sessionFiles: this.historyService.files, so its rows go to that same journal.
PR 12 advisor: aiService.durableEventJournalFor Already done on main: it passes historyService.files and historyService.locks. No code in this PR.
PR 12 advisor: sandboxHostService.journalFor Reasoned close. SandboxHostService has no history service and no session layers in scope. The tests build it with new SandboxHostService(), so routing it needs a new constructor dependency. One hazard stays, and only in tests: on memory layers, aiService and the sandbox host would get two journal instances, and that split would break seq ordering. No test does that today. I searched every test that uses SessionFilesMemory, SessionLocksMemory or the in-memory loop for the sandbox host. The only match, agentSession.turnStopHooks.test.ts, replays a canned code_execution part and has no sandbox host.
PR 12 advisor: memoryService.ts:2739 (appendRefinementEvent) Reasoned close. MemoryService has no SessionLocks or SessionFiles in scope. This is the same reason as the PR 13 target-lock callers: a new constructor dependency, and about 46 test constructions.
PR 12 advisor: refinementRollback (rollbackRefinement's journal and its listRefinements) Reasoned close. rollbackRefinement has opts.locks but no files layer, and the registry needs both. Its two callers (tools/refinement_rollback.ts and cli/debug/refinements.ts) would need a new option through read, validate, apply and append. In the app nothing changes. On memory layers, a rollback would read the Node journal while the skill rows sit in the memory one. No test runs a rollback on memory layers today.
PR 12 advisor: replayVerifySession (replay/replayVerify.ts) Reasoned close. No history service is in scope. It reads the journal of the session dir that its caller names, with new DurableEventJournal(params.sessionDir).
#7485 option in the test layers Done. The memory layer already honors createParentDir (#7485). The foreign-holder layer's acquireProcessFileLock now probes the inner lock when createParentDir is false and a fake holder sits on the path. A missing parent then fails with ENOENT, as the Node lock does before it meets any holder. A lock that the probe takes is released at once. The probe asks the inner layer, not the disk, so it also holds on a memory HostFiles volume.

Validation

  • The new test "a tool row takes its journal locks from the tool config's session locks" (refinementJournal.test.ts) fails when appendRefinementEventFromTool drops layers.
  • The new contract test "foreign: a missing parent wins over a live holder for a file lock without createParentDir" fails without the probe. Its second half (the parent comes back, and the live holder refuses with today's text) fails if the wrapper always hands the call to the inner lock.
  • This PR does not change journal.ts, durableEventJournal.ts, blobStore.ts or fileLock.ts.

Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $209.75

… the session's layers; foreign file locks give ENOENT without createParentDir (#7326)
@ThomasK33
ThomasK33 added this pull request to stack #7508 October 25, 2026 17:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T17:46:45.857569Z dd29211 PR opened
🔒 Security Review ✅ Completed 2026-10-25T17:46:53.299649Z dd29211 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 e2e stories (Haiku): 14 passed

27 agent steps · 7 replayed from cache · 31 model calls · 214.7k tokens (75% cached)
Spend: $0.09 of the $1.00 cap (proxy ledger)

All 14 tests in 9 files
Test Agent Time
🟢 chatRestart.e2e.ts · 1 passed 2 steps · 4 calls 23.4s
🟢 a chat survives a restart of the server 2 steps · 4 calls 23.4s
🟢 compaction.e2e.ts · 1 passed 3 steps · 7 calls 47.4s
🟢 /compact replaces the old chat with a summary 3 steps · 7 calls 47.4s
🟢 pluginTrustRestart.e2e.ts · 1 passed 4 steps · 2 calls 9.7s
🟢 a trusted plugin hook stays trusted after the server restarts 4 steps · 2 calls 9.7s
🟢 settingsRoundTrip.e2e.ts · 1 passed 3 steps · 4 calls 28.6s
🟢 a chat survives trips through Settings 3 steps · 4 calls 28.6s
🟢 sidebarPerWorkspace.e2e.ts · 1 passed 4 steps · 1 call 4.5s
🟢 a new workspace starts with its right sidebar collapsed while another keeps it open 4 steps · 1 call 4.5s
🟢 smoke.e2e.ts · 1 passed 2 steps · 1 call 5.9s
🟢 the agent opens the playground workspace 2 steps · 1 call 5.9s
🟢 streamErrors.e2e.ts · 1 passed 1 step · 1 call 6.9s
🟢 stream errors show in the chat, and the chat recovers 1 step · 1 call 6.9s
🟢 todoNudge.e2e.ts · 1 passed 2 steps · 5 calls 25.0s
🟢 the agent finishes open TODO items after the turn-end nudge 2 steps · 5 calls 25.0s
🟢 touchAlignment.e2e.ts · 6 passed 6 steps · 6 calls 22.6s
🟢 the Settings close button is level with the title on a touch screen 390px wide 1 step · 1 call 3.6s
🟢 the Settings close button is level with the title on a touch screen 768px wide 1 step · 1 call 4.1s
🟢 Backup settings checkboxes are small and level with their labels on a touch phone 1 step · 1 call 4.7s
🟢 the heartbeat checkbox is small and level with its label on a touch phone 1 step · 1 call 3.2s
🟢 a reply's model and time stay on one line on a touch phone 1 step · 1 call 4.3s
🟢 the workspace actions menu stays on the title row on a touch phone 1 step · 1 call 2.6s

e2e 0.20.0 · 2m 57s · web · run artifacts

🟢 e2e Electron stories (Haiku): 3 passed

3 agent steps · 3 model calls · 7.9k tokens (33% cached)
Spend: $0.01 of the $1.00 cap (proxy ledger)

All 3 tests in 3 files
Test Agent Time
🟢 electron/deepLink.e2e.ts · 1 passed 1 step · 1 call 5.2s
🟢 a deep link of a second launch starts a chat in the running app 1 step · 1 call 5.2s
🟢 electron/menuBar.e2e.ts · 1 passed 1 step · 1 call 6.7s
🟢 the workspace menu bar is the desktop title bar 1 step · 1 call 6.7s
🟢 electron/smoke.e2e.ts · 1 passed 1 step · 1 call 5.0s
🟢 Xum Electron opens the playground workspace 1 step · 1 call 5.0s

e2e 0.20.0 · 18.8s · electron · run artifacts

🟢 e2e agent repros (Haiku): no tests selected

Spend: $0.00 of the $1.00 cap (proxy ledger)

e2e 0.20.0 · 5.3s · 2 targets (web, phone) · run artifacts

@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit fe84930 Oct 25, 2026
33 of 34 checks passed
@ThomasK33
ThomasK33 deleted the followups/journal-locks branch October 25, 2026 19:09
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