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

Skip to content

[pull] main from can1357:main - #98

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

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

Conversation

@pull
@pull pull Bot commented Sep 18, 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 : )

pedropaulovc and others added 30 commits September 17, 2026 08:53
A dogfood subagent spent 173 consecutive turns on `yield` calls that never
finished its run. Across a local corpus of 1286 subagent transcripts, 8 of the
10 runs that reached the reminder ladder's forced final yield degenerated the
same way. Two guards should have stopped it and neither fired.

Every assistant turn carrying a `yield` tool call latches `yieldCallPending` at
`message_end` before the soft-budget check reads it, so a run whose turns are
all yield turns never accounts for a single request. 2bf8f43 removed the
`!yieldCalled` half of that gate but left `!yieldCallPending`; the test it
shipped with alternates text, incremental yield, text, and text-only turns
clear the flag, so the hole stayed covered. The suppression is there so an
abort cannot race a yield that is still validating (#5006), and deferring the
check keeps that guarantee: it now runs at the yield's execution end when the
yield did not end the run.

The ladder's final retry pins `toolChoice` to `yield`, and an incremental yield
satisfies that pin without terminating the run, so `session.prompt()` and
`waitForIdle()` never return and the ladder cannot escalate. A forced final
yield is now terminal whatever section labels it carries. The force is armed
for that one prompt's turn only, so the quiescence barrier's async-pending
notice turn can still submit progress sections.

Verification: three regressions in `executor-yield-loop.test.ts` drive the real
`runSubprocess` against a mock session. Against unmodified upstream/main they
record 200 unbounded yield turns, 203 requests under the pin, and a post-park
section finalizing the run. With the fix the budget hard-aborts at 8 requests,
the pinned section completes the run with its data, and the parked run still
waits for a fresh yield. The #5006 test's abort-count instrumentation moved by
one, because the deferred check stops the turn once the rejected yield
resolves; its finalization contract is unchanged. `bun check` is clean and
`bun test test/task` reports 456 pass, with the 2 worktree-isolation budget
failures reproducing on pristine upstream/main.
A hashline section under a stale tag goes through `try_recover`, which
diffs the tagged snapshot against the current file and remaps the anchor
line numbers. `remap_edits` accepted any alignment where the anchor row's
text was unchanged and a neighbouring row agreed on the offset — but in a
file with repeated shapes that is not evidence of identity. The
maximal-LCS alignment actively prefers the duplicate: an insertion aimed
at the list under key "a" was remapped onto the identically shaped list
under key "b" and applied with only a "verify the diff matches your
intent" warning. Reported as pedropaulovc#52, where a `PUT >230:`
landed at line 235 inside the next section of a dict.

No textual signal can separate the two candidates, so the check has to be
syntactic: `context_preserved` compares the chain of enclosing nodes
(each node's kind paired with the trimmed text of the row it opens) at the
authored anchor in the snapshot against the remapped anchor in the current
text. A remap that changes the enclosing constructs is refused, which
falls through to the ordinary stale-tag mismatch error listing the current
hash and lines. Only the first and last anchor of each edit is inspected
so a wide CUT does not parse once per covered line, and files with no
grammar keep an empty chain and are unaffected.

Verified with `cargo nextest run -p pi-edit`: 311/311 pass. The new
`recovery_refuses_a_remap_into_a_sibling_construct` fails on this file's
prior revision (`assertion failed: recovered.is_none()` at
hashline_apply.rs:740), and the
`recovery_remaps_a_shift_inside_the_same_construct` control passes both
before and after, so legitimate stale-anchor recovery still works.
`prompts/hashline.md` tells the model "Elisions UNSEEN: `…`, `..`,
collapsed `N-M:` rows. NEVER hunk in/across one" and, in the critical
block, that undisplayed hunks are REJECTED. Nothing enforced that:
`edit.enforceSeenLines` has defaulted to false since d50cc4e made the
guard opt-in, so `assert_seen_lines` never ran and a hunk anchored inside
an elided region was applied against line numbers the model could not have
read.

The failure is quiet and can be syntactically valid. In
pedropaulovc#52 a `PUT 1442.=1442:` on a line a tagged read had
never displayed was "auto-repaired" — the syntax probe retained the source
boundary row the range had selected and spliced the body into the
preceding call, turning an intended argument of one call into an argument
of its neighbour. Locally the same shape produces a file CPython accepts,
so nothing surfaces until runtime.

Flip the default. The guard stays conservative: it returns Ok(()) when the
file has no recorded provenance or no seen-line set, so write-then-edit
and unanchored flows are untouched; it only fires when a read or search
recorded which lines were actually displayed. The rejection reveals the
real content of the anchored lines and records them as seen, so a straight
retry under the same tag succeeds without a re-read.

Verified with `bun --cwd=packages/coding-agent check` (oxlint, oxfmt,
tsgo) and the new read-edit-seen-lines regression, which reads
`draw.py:7-7` (displaying lines 1,2,5,6,7 and eliding 3-4), then anchors
`PUT 4.=4:` on an elided line. It fails with the previous default — the
edit applies and the file changes — and passes now with the file
unchanged; the sibling case anchored on displayed line 7 still applies.
…d-stale-remap

fix(edit): honour the seen-line guard and refuse cross-construct stale remaps
fix(coding-agent): bound subagent runs that only emit incremental yields
- Introduced `HubFrame` to centralize fullscreen sidebar, footer, and navigation layout management.
- Consolidated shared utilities for text formatting, string sanitization, and diagnostic parsing across TUI packages.
- Extracted common layout and theme constants into shared modules to reduce redundancy and improve consistency.
- Standardized command output processing by unifying truncation and trailing notice removal logic.
- Introduced a `TokenRateMeter` instance on `AgentSession` and exposed it via a `tokenRate` property.
- Moved token-rate handling from `EventController` to `AgentSession` and `InteractiveMode`, adding seeding, reset, and per-session tracking.
- Added a `seed` method to `TokenRateMeter`, updated its documentation, and added tests verifying seeding behavior.
- Replaced manual temporary directory handling with TempDir in eval and tools tests.
- Switched CLI runner import to use a file URL, avoiding repository-relative paths.
- Added guard for visible browser tests based on OMP_TEST_VISIBLE_BROWSER env variable.
…glued tags

- Introduced edit_header to generate `<SM:EDIT>` opener with path and all flag.
- Implemented unglue_tag to split lines where block tags are glued to content.
- Updated parsing, payload rendering, and error messages to propagate the target path, and adjusted tests accordingly.
- Centralized text sanitization, path shortening, and line-padding utilities into shared modules within `packages/tui`.
- Migrated core domain models, interfaces, and UI rendering logic from `coding-agent` into `pi-tui` to eliminate redundant local definitions.
- Standardized UI component rendering by adopting shared utilities for agent statistics, task previews, and status line formatting.
- Cleaned up auxiliary helper functions and hardcoded constants across components in favor of unified theme-driven implementations.
- Replaced static interruption message with a concise placeholder.
- Added IRC tag with `from="parent"` and `agent` placeholder.
- Adjusted formatting to use bracketed wait indicator.
- Streamline `AgentSession` event delivery by executing synchronous internal logic before awaiting extension listeners.
- Remove `subscriberEmitGate` in favor of ordered persistence queues to prevent stalled extension listeners from blocking critical session state updates.
- Refactor `#queueMessageEndPersistence` to use a promise-based chain, ensuring consistent message order while decoupling from external notification delays.
- Ensure turn-boundary maintenance and steering remain responsive even when tool result listeners are held or stalled.
- Add regression test to verify steering queue processing correctly handles interruptions during stalled extension events.
…er tool interruption

- Updated comment in `AgentSession.persistMessageEnd` to clarify that a session replacement may occur before a queued commit runs, preventing old conversation from being appended.
- Revised multiple tests to verify that pending notifications are drained before releasing retained memory and that late persistence does not repopulate disposed or new sessions.
- Added a changelog entry documenting the fix for subagents leaving parent messages queued after a tool interruption when an extension notification stalls.
…mpty placeholders

- Simplified eval tool renderer by removing unnecessary blank line insertion before JSON lines.
- Updated JsonTreeRenderOptions to rename rootConnectors, set default to "hooked", and adjust rendering logic accordingly.
- Eliminated placeholder rows for empty arrays and objects, and refined scalar rendering with theme-based colors.
- Introduced the `omp stream` CLI command to support real-time terminal broadcasting with live viewer chat and viewer count tracking.
- Implemented a robust streaming protocol using newline-delimited JSON IPC, with integrated automated reconnection, state replay, and periodic frame flushing.
- Added a security-focused redaction layer that filters PII, environment variables, and sensitive API patterns from broadcasted terminal frames.
- Updated the TUI architecture to expose a paint listener system, allowing external modules to capture and publish terminal UI state updates.
- Implemented relay availability probing that distinguishes between absent extensions and reaped background workers.
- Added `extensionSeen` state to the relay bridge to track whether a browser extension has successfully connected.
- Updated the relay `/json/version` endpoint to return server uptime and connection history in 503 responses.
- Optimized `waitForRelayExtension` to fail fast when no extension is present instead of polling for the full timeout.
- Introduced `rawHttpGet` to enable reliable body reading during relay connection probing.
- Implemented a Symbol-based cache on streamed edit arguments to avoid repeated native inspections.
- Updated `#inspect` in `EditTool` and rendering helpers to store and reuse inspection results, handling errors accordingly.
- Added TypeScript interfaces for the cached inspection data.
…on for streaming

- Implemented a full-screen TUI for `omp stream` that includes owner chat, viewer counts, and pane management.
- Integrated Stencil OAuth for host authentication, deriving channel ownership directly from user identity.
- Added `stencil` as a managed auth provider in the catalog with support for base and auth URL overrides.
- Simplified `omp stream` invocation by removing the channel argument, now automatically resolved by the server.
- Added support for `--no-tui` to provide a fallback line-oriented output mode for non-interactive environments.
- Updated wire protocol with new authentication close codes and session user tracking.
…imeout logging

- Changed REPAIR_TIMEOUT_MS from 60 000 ms to 20 000 ms.
- Added debug logging of the model name when auto-repair starts.
- Implemented abort handling that throws an error on timeout, including the model name.
- Replaced `WeakMap` memoization with `stamp` pattern to maintain stable object references for injected intent schemas.
- Stabilized tool parameters across `normalizeTools` calls to ensure downstream schema caches effectively hit.
- Added regression tests in `normalize-tools-prune.test.ts` to verify parameter identity and separation between pruned and unpruned states.
- Optimized `normalizeTools` execution paths to avoid redundant object recreation during schema intent injection.
- Transitioned tool call processing to use `parseStreamingJsonThrottled` for O(N log N) performance.
- Enforced strict lifecycle management of `parsedLenByIndex` state in `processProxyEvent`.
- Removed redundant null-checks on `parsedLenByIndex` to improve predictability.
- Implemented override collision handling in getOverrideIndex to ensure deterministic lookup results.
- Locked provider-specific overrides to the first defined entry, matching previous linear scan behavior.
- Retained original lookup performance by pre-computing indices while enforcing stable resolution.
can1357 and others added 8 commits September 17, 2026 23:26
- Centralized newline counting into `pi-utils` using a performant native `indexOf` scan.
- Standardized line count logic across session persistence and file reading modules.
- Streamlined `SessionStatsTracker` message loop to remove redundant logic and unnecessary variables.
- Removed deprecated `session-stats` benchmark file.
- Simplify stringifyJson by removing the double-pass BigInt probe, allowing a single retry pass on TypeError.
- Improve cacheKey logic by using explicit length-prefixed tuples instead of complex hash chains for which lookups.
- Ensure strict cache isolation for command, cwd, and PATH combinations to prevent collisions in path resolution.
- Update JSON serialization tests to reflect single-retry behavior for stateful serializers and non-TypeError failures.
Both crates declare `[lints] workspace = true`, but the opted-in crate list
in the rust_validate job predates them, so CI linted them with default
clippy + -Dwarnings instead of the workspace policy. Release v18.2.5 failed
on three `too_many_arguments` hits in pi-edit's sloppy mode that the
workspace policy explicitly allows (and that `cargo clippy` passes locally).
…ed session tests

The `stream.serverUrl` / `stream.redactPatterns` settings declared
`ui.group: "Stream"` on the interaction tab without registering the
section in `TAB_GROUPS`, so the settings panel could not order it.

The remaining failures were tests pinning behavior that b9d7ee8
deliberately changed: session subscribers are now notified before
extension listeners settle, and message persistence no longer waits on
extension hooks. The auto-compaction tests waited a fixed number of
microtasks for continuation scheduling that now lands behind the
extension notification; they now wait on the observable (the armed
delay timer, a macrotask turn, or waitForIdle). The empty-stop and
advisor tests used a held message_end hook as a device to delay
persistence, which the decoupling makes impossible; they now assert the
contract that survives — a stalled hook cannot block the capped
empty-stop discard or the prompt, and the advisor card is durable while
catch-up still waits for its hooks.

Also records `stencil` in the paste-code login set; its oauth-code
login defaults to paste-code and instructs users to paste the redirect.
fix(auth-broker): use node:fs for token and config reads on Windows
@pull pull Bot locked and limited conversation to collaborators Sep 18, 2026
@pull pull Bot added the ⤵️ pull label Sep 18, 2026
@pull
pull Bot merged commit 62a4aa9 into ericrihm:main Sep 18, 2026
4 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.

3 participants

0