8000 [pull] main from can1357:main by pull[bot] · Pull Request #130 · ericrihm/oh-my-pi · GitHub
[go: up one dir, main page]

Skip to content

[pull] main from can1357:main - #130

Merged
pull[bot] merged 349 commits into
ericrihm:mainfrom
can1357:main
Sep 28, 2026
Merged

pull[bot] merged 349 commits into
ericrihm:mainfrom
can1357:main

Conversation

@pull
@pull pull Bot commented Sep 28, 2026 •
Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

sjawhar and others added 30 commits September 26, 2026 19:50
… final message at dispose

`AgentSession#recordSessionExit` appends the session-exit bookkeeping entry
and calls `flushSync()` immediately after the final turn's own
message-persist, with no further append to trigger the existing cold-path
recovery. Both rewrites go through `SessionManager#rewriteSynchronously()` ->
`IndexedSessionStorage.writeTextSync()`, which updates the storage's local
index synchronously before queuing the backend publish; `SessionManager`'s
own `#expectedDiskSize` only advances once that publish confirms. For any
deferred-publish backend (SqlSessionStorage, RedisSessionStorage), the
exit-record's rewrite routinely fires before the prior publish confirms,
throws `SessionWriteConflictError` purely locally -- the backend never sees
the second write -- and permanently latches `#diskFailure`.

`AgentSession#doDispose` calls `seal()` then `close()`, never `flush()`.
`seal()` disables the ordinary mid-life repair path
(`#authoritativelyRewriteCurrentStateLocked` returns without writing once
`#released`) on purpose, so a revived session never races a stale handler's
rewrite. `close()`'s first disk-work item then refused on the already-latched
failure before ever draining, so the still-outstanding (and otherwise fine)
first publish never got the chance to confirm. print-mode and rpc-mode both
catch that rejection and report the transcript lost; a real Postgres repro
left zero rows after the process exited.

`close()` now runs its writer-close and drain unconditionally
(`ignorePriorError`), so this manager's own in-flight publish gets the chance
to land, and -- if a conflict is still latched afterward -- issues one
terminal catch-up rewrite directly with the now-current confirmed size token,
bypassing the seal-gated repair helper since this is the terminal write
close() itself owns, not a stale handler.

Upstream #12624 is a different, larger redesign for a different scenario
(reconciling a second process' foreign entries on the same file); this fix is
narrower and does not touch `#noteDiskFailure`'s latch semantics for that
case.

Tests: session-manager-dispose-recovers-write-race.test.ts (new, red before
this commit, green after: close() rejected pre-fix with the final message
never reaching the backend, resolves post-fix with both the final message
and the exit record durable); bun check exit 0; the existing
session-manager/indexed-storage regression suite (60 tests across 7 files)
stays green.
…s readback repair

roboomp's review on #13415 found one blocker and one should-fix in the
diagnosis-approved diff, plus two nits.

Blocking: the added `flush()` hunk called `recoverPersistenceFromCurrentState()`,
which acquires `#withAtomicPersistenceLock`. `appendEntriesAtomically()` holds
that same lock for its whole duration (via `#withAtomicPersistenceLock`) and
calls `flush()` from inside it, so the inner acquisition deadlocks: the outer
turn cannot resolve until the inner one gets a turn, and the inner one cannot
get a turn until the outer one releases the lock. The hunk was also
unreachable for this PR's own bug (if `#diskFailure` is already latched when
flush() starts, the first `#scheduleDiskWork` -- no `ignorePriorError` --
throws before ever reaching it) and untested. Dropped entirely; the bug this
PR fixes only needs `close()`'s own repair.

Should-fix: close()'s terminal rewrite was a trimmed copy of
`#authoritativelyRewriteCurrentStateLocked` missing that function's disk-queue
serialization, its readback-on-failure fallback, and any guard against
recreating a file `#dropIfEmptyAndNoDraft()` just legitimately deleted.
Extracted the write-and-readback loop into `#publishAuthoritativeBody()`,
shared by both the locked repair path and close(); close() now runs its
terminal rewrite through `#scheduleDiskWork(..., { ignorePriorError: true })`,
only when `#shouldHaveSessionFile()` is true, and a new `#entriesReleased`
flag (set by `releaseRetainedEntries()`) blocks it if entries were ever
cleared first -- defense in depth, since every current caller already calls
close() before release.

Nits: trimmed the close() doc comment to two lines (the flush() comment is
gone with the dropped hunk) and reformatted the CHANGELOG entry to one
user-facing line per AGENTS.md's Changelog rule.

Tests:
- session-manager-flush-atomic-lock-reentry.test.ts (new): reproduces the
  reentrant deadlock via a background `onError` failure landing mid-`drain()`.
  Red with the hunk restored (times out); green with it removed.
- session-manager-dispose-recovers-write-race.test.ts: added a third case
  ("close()'s terminal rewrite tolerates an ack-lost write that landed
  durably anyway") against `MemorySessionStorage` (whose `writeTextAtomic` has
  no readback of its own, unlike `IndexedSessionStorage`'s). Red against the
  original terminal-rewrite code (close() rejects even though the content
  landed); green against `#publishAuthoritativeBody`.
- bun check (types + lint) exit 0; bun test test/session: 694 pass, 3 fail,
  1 error -- all three pre-existing/unrelated (session-loader-stream.test.ts
  and session-fork-prompt-cache-key.test.ts timeouts under this box's load,
  matching the PR's own testing notes about flakiness in this suite).
…ish backends

Main found 3 shutdown-test regressions on the composed sami tree, all going
through close()'s terminal rewrite. Bisected: all 3 already fail at
28b913d (the original PR diff, before this branch's review-round fixes),
not something the review-round repair introduced -- the original PR's own
terminal-rewrite addition is the root cause.

The terminal rewrite ran for ANY latched `#diskFailure`, not only the
self-conflict race this PR targets. That race is specific to deferred-publish
backends (`IndexedSessionStorage` and its `SqlSessionStorage`/
`RedisSessionStorage` subclasses): `writeTextSync` updates the local index
synchronously while the backend publish confirms later, so a second rewrite
before that confirm can conflict with state the manager's own drain() can
resolve. A synchronous backend (`FileSessionStorage`/`MemorySessionStorage`)
has no such race -- `drain()` there is a no-op -- so any latched failure is
either a genuine external conflict (which must NOT be silently overwritten)
or a permanent failure (ENOSPC/EACCES) the retry cannot help. Attempting the
repair there turned a real, correctly-typed error into a misleading
"Authoritative session repair did not match durable storage." one:

- interactive-mode-sh
8000
utdown-write-conflict.test.ts: an externally corrupted
  session file's genuine `SessionWriteConflictError` got wrapped into
  `SessionPersistenceIndeterminateError`, losing the type the guard's own
  regression test asserts on and losing the "refuses to clobber" guarantee
  (close()'s retry doesn't touch the file if it isn't attempted at all).
- headless-persistence-shutdown.test.ts: a from-first-write ENOSPC failure
  (no successful write ever landed) got a pointless repair attempt whose own
  read-back failure (file never existed) added a raw stack dump to stderr.
- rpc-shutdown-persistence.test.ts: an EACCES permission failure got the same
  pointless retry, replacing the expected "still failing at shutdown"
  message with a different one from the retry's own new failure.

Fix: gate the terminal rewrite on `this.#storage.defersSyncPublish`, so it
only fires for the backend class where this PR's own diagnosis says the race
can happen, matching the PR body's own scope ("Any deferred-publish
backend"). Updated the review round's own regression test (which used
`MemorySessionStorage` specifically to avoid `IndexedSessionStorage`'s
readback masking the gap) to use a `defersSyncPublish`-flagged subclass, so
close()'s gate still lets its readback-tolerance repair run.

Bisection evidence (test/interactive-mode-shutdown-write-conflict.test.ts,
test/headless-persistence-shutdown.test.ts, test/modes/rpc-shutdown-persistence.test.ts):
- v18.3.2 (7853b4e): 8 pass, 0 fail.
- 28b913d (original PR, pre-review-round): 5 pass, 3 fail -- same 3
  tests Main reported, confirming the original PR introduced them.
- 96339bf (review-round fix, pre-this-commit): 5 pass, 3 fail -- same 3,
  confirming the review-round repair carried the bug forward unchanged
  rather than introducing it.
- This commit: 8 pass, 0 fail.

Full verification after this commit: the same 3 files together with
test/session (705 tests, 90 files): 703 pass, 2 fail -- session-loader-stream.test.ts
and session-fork-prompt-cache-key.test.ts, both pre-existing timeout
flakiness unrelated to this change (matches this PR's own testing notes and
this branch's prior notch record). bun check:types exit 0. oxlint exit 0 on
all touched files. The two review-round regression tests
(session-manager-flush-atomic-lock-reentry.test.ts,
session-manager-dispose-recovers-write-race.test.ts) still pass.
…ok's env as tool input

`createBashToolDefinition` forwarded `env: spawn?.env` into the registry
bash tool. Since 18.3 that field is service-launch configuration and the
tool rejects it without a service name, so an extension that registers
bash through the legacy shim with a `spawnHook` made every agent bash
call fail with "ready and env require a service name." The legacy schema
has no `name`, so service mode is unreachable there and the field could
only ever produce that error; bash last honoured a per-call `env` before
18.2.7 removed it, after which the shim silently dropped it anyway.

A hook's env still reaches `!` user shells through `shellEnv` and the
`operations` branch through its exec options, both unchanged.

Defect fix, carried by red->green evidence; it implements no recorded
ruling and changes nothing a deployment configures. The new test covers
the registry path, which had none - the existing spawn-hook test only
exercises the `operations` override that bypasses the tool.

Red before, green after:
  bun test test/extensibility/legacy-pi-inplace-load.test.ts -t 'spawn hook against the real tool'
  before: 0 pass 1 fail (ToolError: ready and env require a service name.)
  after:  1 pass 0 fail

Omp-Session: 01a0dba6-1c3e-7537-80b0-6494b21465f1
Omp-Session: 01a0dba6-1c3e-7537-80b0-6494b21465f1
… behaviour

Omp-Session: 01a0dba6-1c3e-7537-80b0-6494b21465f1
…nk rules

Cause: one-off prepared statements stayed unfinalized after AgentStorage.close(), so SQLite kept agent.db open until GC and Windows could not remove it. The config symlink walk followed POSIX dot-segment rules on Windows and could save to a file the link never reads.
Change: scope one-off statements with `using`; normalize Windows symlink targets before the walk; isolate USERPROFILE in the storage exit test.
Cause: the model hub's fallback-chain writer and the /agents hub read the
merged record/list and wrote it whole to the global layer, so every entry a
--config overlay supplied was saved into config.yml.
Change: add Setting.setEntry (record entry, undefined deletes) and
Setting.setMember (list item) backed by Settings.writeEntry/writeMember;
pending global writes are keyed by path segments so dotted entry keys
(model ids) persist and merge with external edits exactly. The fallback
writer uses setEntry; AgentsHubDeps now exposes setAgentDisabled and
setAgentOverride (PropertyKind exported), backed by setMember/setEntry.
When a hashline edit is rejected because its tag is not from this
session, the rejection only named the caller's spelling and suggested
re-reading — while store.find_by_hash already knew the absolute path
the tag was actually issued for. A worktree lane that pasted a tag
from the parent checkout would follow the suggested hash and land the
write in the wrong tree (#13370, three incidents).

format_mismatch_message now lists every path in this session that
issued the same tag, so the first rejection stops the retry loop.
MismatchDetails gains tag_origin_paths, populated by the single
mismatch() construction site in patcher.rs via find_by_hash,
excluding the path being written.
- Stated that bash.patterns globs and commands collapse whitespace runs to one space, so a newline in a glob matches any whitespace ("*
*" acts as "* *").

- Noted that newline-specific deny rules are unnecessary since deny/prompt match per segment and allow never approves multi-line commands.

Fixes #13466
Qualified the multiline allow policy: unquoted newline separators are rejected, while quoted or escaped literal newlines can match an allow rule.

Fixes #13466
A failed cedar_ember/juniper_tide probe (429, timeout, parse failure) returned
null, which fetchClaudeUsage treated as 'no resets' and cached as a fresh
success, so resetCredits vanished for whichever account lost the per-IP /usage
race. Carry the credential's last known block forward via a new optional
UsageFetchContext.previousReport, and drop only the spent credential's block
on post-redemption invalidation so a failed follow-up probe cannot resurrect
pre-spend inventory.

agent-identity: dev3.direct.omp.ezvfpyhz
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.3.1
agent-runtime: OMP 18.3.1
agent-model: anthropic/claude-opus-5-5
tooling-profile: dotfiles@7d890da
agent-identity: dev3.direct.omp.ezvfpyhz
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.3.1
agent-runtime: OMP 18.3.1
agent-model: anthropic/claude-opus-5-5
tooling-profile: dotfiles@7d890da
Herdr panes report TERM=xterm-256color without TERM_PROGRAM, so hyperlink
detection treated them as an unknown terminal and kept OSC 8 off. Herdr
renders OSC 8 in its own grid and opens links on Ctrl+click, so enable
hyperlinks inside a Herdr pane unless screen or tmux is nested in it.
…wn descriptions

recall/reflect/memory_edit descriptions cross-reference each other; with
tools.xdev (default on) those tools are xd:// devices, so the bare names in
their docs were not callable. Render the descriptions with memoryToolRefs,
matching the memory instructions fixed in 1012eb9.
…ice entries

xdevEntries() computes catalog summaries, which read a device's description
when it declares no summary; calling it from a memory tool's description
getter could recurse without bound. Use xdev.mountedNames directly.
can1357 and others added 27 commits September 28, 2026 06:48
(cherry picked from commit d798c3b08a5c4ae6a3027c05f593193635cc501e)
Add cursor cost-patch rules direct from Cursor's pricing page (121/129 roster ids priced, including Grok 4.7 wire ids and Claude Opus 5.5; docs-absent ids stay unpriced rather than proxied). Regen rules.json and rebake the cursor slice of models.json; add cursor-pricing regression tests.

(cherry picked from commit b8d9774)
- Rebuilt package changelogs from the baseline with only the bullets the merged PRs add, keeping released sections untouched.
- Added entries for merged fixes whose PRs omitted one.
- Replaced resolveSpeculationMethod's positional skipRemote flag with an options object.
- Declared the vendored export viewer scripts as file-asset imports.
- Formatted merged tests.
- Moved the #13476 bullets out of the released 18.3.x sections the merge placed them in.
- Credited @aktanazat.
…submit text (@Dante-dan)

# Conflicts:
#	packages/tui/src/terminal.ts
(cherry picked from commit 365662764d80a246a607a23617b90779b6457427)
- Bumped the Devin CLI request identity from 3000.6.2 to the current stable 3000.11.3 (Fusion routing arrived in 3000.10.21).
- Taken from #13527 without its Fusion removal or default-model change.
- Moved the #13073, #12748 and #13209 bullets out of released sections.
- Added entries for #13440 and #13212, which shipped without one.
- Dropped stale bullets the merge re-added to the released 18.4.0 section.
- Credited @aktanazat.
(cherry picked from commit 6998ffc8931badaa86e45e157d4a6b2cceb0aba4)
…iveness

- Added `resolveCatalogAxes` to `compat/resolve` to minimize model-catalog lookups.
- Deferred non-critical startup work (retry chain validation, registry refresh) past the first session frame.
- Enhanced status bar startup to show project context while eliding stale session details.
- Implemented cfgLspEnabled gating for LSP discovery and startup composer LSP servers.
- Composer cache now stores null for LSP servers to indicate LSP disabled.
- Welcome component renders LSP section only when servers are non-null, otherwise omits it.
- Interactive mode returns null for LSP servers when discovery is skipped, preserving UI state.
- Added tests verifying that disabling LSP hides the welcome LSP section.
- Migrated speculative composer state to a single SQLite database (`composer.db`) for improved reliability and atomicity.
- Optimized startup: LSP server discovery and warmup are skipped when `--no-lsp` or `lsp.enabled: false` is set.
- Unified status-bar rendering by introducing a dedicated startup component that uses persisted session state.
- Enabled cross-directory context sharing for subagents and sessions of the same agent by fixing system-prompt caching behavior.
- Removed legacy file-based composer caches in favor of SQLite.
…ry usage

- Refactored Anthropic system cache breakpoint logic to anchor before volatile sections (memory recall, project context), enabling cache hits across different working directories.
- Moved working-directory context (context files, tree, roots) into a consistent `<project-context>` block.
- Optimized `find` keyword scanning by streaming matches and counting occurrences incrementally, preventing excessive memory usage on large trees.
- Simplified Anthropic system prompt generation to allow per-spawn subagent text to exist without breaking prefix caching.
- Added `onMatches` callback option to `grep` to stream search results in bounded batches of 1024.
- Implemented `MatchSink` trait to handle cross-thread delivery and backpressure, pausing search workers when the JS callback queue is saturated.
- Optimized memory usage in high-match scenarios by replacing full-result accumulation with chunked streaming in `grep`.
- Added `JsMatchStream` to coordinate batch delivery, synchronization, and error propagation between Rust search threads and JS.
- Updated `grep` return behavior to return match counts instead of full result arrays when streaming is active.
…uplication behavior

- The comment now explains that the duplicated file descriptor keeps the pump alive if the original is closed or replaced, and that file-status flags such as O_NONBLOCK are shared and handled via POLLOUT.
- Regenerated via gen:bazel-lock; crate_universe input Cargo.lock changed in 112a54a and the freshness check failed on CI.
- Without cargo in the Bazel sandbox, insta fell back to CARGO_MANIFEST_DIR as the workspace root and looked up snapshots under a doubled package path, failing every snapshot test in Validate Rust workspace (bazel).
- Set INSTA_WORKSPACE_ROOT to the runfiles root and INSTA_UPDATE=no so tests never write .snap.new into runfiles.
- The yield-reminder loop now calls session.hasPendingAsyncWork() unguarded (#13411); fakes built on createSessionDefaults lacked it, so the aliased-bus soft-budget test's run threw and settled as failed instead of completed.
- Real AgentSession always implements it; the shared default mirrors an idle session.
@pull pull Bot locked and limited conversation to collaborators Sep 28, 2026
@pull pull Bot added the ⤵️ pull label Sep 28, 2026
@pull
pull Bot merged commit 2e07c17 into ericrihm:main Sep 28, 2026
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0