Repository navigation
🤖 refactor: skill-tool refinement rows and refine's journal reads use the session's layers - #7507
Merged
Merged
Conversation
… the session's layers; foreign file locks give ENOENT without createParentDir (#7326)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
🟢 e2e stories (Haiku): 14 passed27 agent steps · 7 replayed from cache · 31 model calls · 214.7k tokens (75% cached) All 14 tests in 9 files
e2e 0.20.0 · 2m 57s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 7.9k tokens (33% cached) All 3 tests in 3 files
e2e 0.20.0 · 18.8s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 5.3s · 2 targets (web, phone) · run artifacts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR closes the PR 12 (#7404) journal follow-ups of #7326 and mirrors #7485's
createParentDiroption 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.
RefineServicereads its seq baseline and its staged rows through its history's layers. The skill-write config ofRefineServicenow carries the history's session files. A test graph on memory layers therefore writes and reads one journal, the one thataiService.durableEventJournalForuses.Refs #7326
Items
appendRefinementEventwriters ofsharedDurableEventJournal(the skill tools)RefinementEmitArgsgetslayers, andappendRefinementEventFromToolpasses the tool config'ssessionFilesandsessionLocks. ThesessionLocksfield became required in PR B.refineService.ts:1245reads the shared journalreadMaxJournalSeqandlistStagedRefinementRowsboth read throughjournalLayers(), which returns the history's files and locks.listRefinementstakes optionallayersfor this caller, so the baseline and the staged rows come from one journal. The skill-write config ofRefineServicesetssessionFiles: this.historyService.files, so its rows go to that same journal.aiService.durableEventJournalForhistoryService.filesandhistoryService.locks. No code in this PR.sandboxHostService.journalForSandboxHostServicehas no history service and no session layers in scope. The tests build it withnew SandboxHostService(), so routing it needs a new constructor dependency. One hazard stays, and only in tests: on memory layers,aiServiceand 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 usesSessionFilesMemory,SessionLocksMemoryor the in-memory loop for the sandbox host. The only match,agentSession.turnStopHooks.test.ts, replays a cannedcode_executionpart and has no sandbox host.memoryService.ts:2739(appendRefinementEvent)MemoryServicehas noSessionLocksorSessionFilesin scope. This is the same reason as the PR 13 target-lock callers: a new constructor dependency, and about 46 test constructions.refinementRollback(rollbackRefinement's journal and itslistRefinements)rollbackRefinementhasopts.locksbut no files layer, and the registry needs both. Its two callers (tools/refinement_rollback.tsandcli/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.replayVerifySession(replay/replayVerify.ts)new DurableEventJournal(params.sessionDir).createParentDir(#7485). The foreign-holder layer'sacquireProcessFileLocknow probes the inner lock whencreateParentDiris 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 memoryHostFilesvolume.Validation
refinementJournal.test.ts) fails whenappendRefinementEventFromTooldropslayers.journal.ts,durableEventJournal.ts,blobStore.tsorfileLock.ts.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$209.75