Commit Graph

6825 Commits

Author SHA1 Message Date
can1357 9ad82cbe6e test(coding-agent): simulated production env in unref worker repro
The CI harness exports PI_TEST_RUNTIME=1, which the wrapper subprocess
inherited; isBunTestRuntime() then suppressed unref in the worker client
and deterministically kept the wrapper alive until the test timed out.
Override PI_TEST_RUNTIME=0 in the wrapper env and restore the 10s bound.
2026-08-01 23:15:11 +02:00
can1357 2d27412022 test(coding-agent): aligned activation tests with write-gated xd mounting
- Updated sdk-tool-activation expectations for 386385f18b: sessions
  without a granted write tool keep extension/SDK tools top-level and
  allocate no xd:// state instead of auto-granting write.
- Raised the unref'd-worker parent-exit repro to a 30s timeout; the 10s
  ceiling SIGTERMed the wrapper (exit 143) on shared-core CI runners.
2026-08-01 23:05:28 +02:00
can1357 23c629be18 test(coding-agent): aligned deferred MCP test with write-gated xd mounting
386385f18b made xd:// mounting require both granted transport halves and
stopped auto-granting write; a read-only session now surfaces deferred
MCP tools top-level. The test still encoded the old auto-grant contract.
2026-08-01 22:55:01 +02:00
can1357 811fcde05f Merge PR #7306: fix(title): reject overlong auto-generated session titles (@roboomp) 2026-08-01 21:29:46 +02:00
can1357 8fe2b8f9ba Merge PR #7311: fix(catalog): honor openrouter deepseek effort metadata (@roboomp) 2026-08-01 21:29:35 +02:00
roboomp 2cfaeb6116 fix(catalog): honored openrouter deepseek effort metadata
- Parsed OpenRouter reasoning effort ladders and defaults during discovery.

- Preserved explicit thinking metadata from models.yml patches.

- Regenerated the catalog and covered both regression paths.

Fixes #7307
2026-08-01 19:06:44 +00:00
can1357 992963f949 feat(coding-agent): allowed switching to models smaller than session context with compaction
- Make over-context models selectable in the model picker by graying them instead of disabling them.
- Trigger automatic session compaction with the current model prior to switching when an over-context model is chosen.
2026-08-01 20:59:24 +02:00
roboomp 294f32d6bc fix(title): reject overlong auto-generated session titles
normalizeGeneratedTitle only guarded emptiness and the none sentinel, so
when the tiny title model ignored the titling task and answered the first
user message, its full one-line reply became the session title verbatim.
Bound accepted titles to 80 chars / 12 words and return null past that,
deferring titling to the next user turn. Both the online and local-worker
paths funnel through this normalizer, so both are covered.

Fixes #7303
2026-08-01 18:50:28 +00:00
can1357 386385f18b fix(coding-agent): skipped xd:// mounting when write tool is not granted
- Prevent xdev state allocation and tool mounting in sessions lacking a write tool.
- Expose discoverable tools top-level instead of auto-granting write transports.
2026-08-01 20:39:08 +02:00
can1357 13a36f7c83 refactor(coding-agent/mcp): changed default MCP request ID format to sequential integers
- Change the default MCP JSON-RPC request ID format from snowflake strings to sequential integers.
- Update server configuration schema, connection equivalence checks, and tests to reflect the new integer default.
2026-08-01 20:33:11 +02:00
can1357 9f65d3ae71 chore: applied biome formatting to sweep fix commits 2026-08-01 20:15:15 +02:00
can1357 51afd5c503 fix(coding-agent): tombstone remote hub kills 2026-08-01 20:14:41 +02:00
can1357 cc884eea9b Merge PR #7252: fix(coding-agent): keep hub-killed subagent from resurrecting as parked (@roboomp) 2026-08-01 20:14:40 +02:00
can1357 3fd042c38b fix(coding-agent): preserve grouped reads during retraction 2026-08-01 20:14:40 +02:00
can1357 191872990e Merge PR #6881: fix(coding-agent): retract superseded turn's tool cards to stop double render (@roboomp) 2026-08-01 20:14:40 +02:00
can1357 1088ee2127 Merge PR #7203: fix(tui): render mid-turn steering skips as info, not errors (@roboomp) 2026-08-01 20:14:40 +02:00
can1357 61d066bd2a Merge PR #6756: fix(coding-agent): suppress WIP advisor non-blockers (@wolfiesch) 2026-08-01 20:14:39 +02:00
can1357 60d5b9b49d fix(coding-agent): classify host before auth storage 2026-08-01 20:13:40 +02:00
can1357 539e7277d0 fix(session): fence title updates during moves 2026-08-01 20:13:39 +02:00
can1357 6948d34573 Merge PR #7271: fix(session): fence appends during session moves (@roboomp) 2026-08-01 20:13:39 +02:00
can1357 be834905a6 test(extensions): tighten nested wildcard coverage 2026-08-01 20:13:39 +02:00
can1357 533f7bcbf7 Merge PR #7277: fix(extensions): bundle nested wildcard export subpaths for compiled binaries (@harshav167) 2026-08-01 20:13:39 +02:00
can1357 890dc0c55d Merge PR #7195: fix(coding-agent): omit unsupported Anthropic search temperature (@will-bogusz) 2026-08-01 20:13:38 +02:00
can1357 237aa46faf fix(coding-agent): refreshed repo context after cwd changes 2026-08-01 20:13:38 +02:00
can1357 93a9f0d991 Merge PR #7262: fix(coding-agent): refresh context files on plugin reload (@roboomp) 2026-08-01 20:13:38 +02:00
can1357 5e819172a5 Merge PR #7285: fix(coding-agent): preserve explicit extensions in isolation (@alphastorm) 2026-08-01 20:13:38 +02:00
can1357 4a83ea86fc Merge PR #7107: feat(mcp): let a server opt into integer JSON-RPC request ids (@kodlian) 2026-08-01 20:13:38 +02:00
can1357 efc515d77c Merge PR #7251: fix(memory): clarify /memory stats and /memory diagnose message when memory is off (@KennethHoff) 2026-08-01 20:13:37 +02:00
can1357 6cf01fe5dc fix(keybindings): preserve explicit shift-up remaps 2026-08-01 20:13:37 +02:00
can1357 aaeb14c850 Merge PR #7149: feat(keybindings): accept shift+up for the steering dequeue (@metaphorics) 2026-08-01 20:13:37 +02:00
Sunil Srivatsa f22c0edbfa fix(coding-agent): scope SDK extension packages 2026-08-01 13:50:53 -04:00
Sunil Srivatsa df38e5b48e fix(coding-agent): rebind relative extension roots 2026-08-01 13:24:11 -04:00
Sunil Srivatsa b1a46eec5c fix(coding-agent): ignore unreadable hook dirs 2026-08-01 13:15:19 -04:00
roboomp 8378d523ce fix(collab): converted guest prompts in side requests
Routed direct custom-message conversion through the collab steering transform so side requests and compaction see the same enveloped user turn as primary requests.

Extended the regression test to exercise convertToLlm without transformContext.
2026-08-01 17:10:36 +00:00
Sunil Srivatsa 5d8a2d6b82 fix(coding-agent): scope explicit hook discovery 2026-08-01 13:04:04 -04:00
roboomp 352c0fdce2 fix(collab): treated guest prompts as user interjections
Converted user-attributed collab prompt frames to prioritized user messages only on the model-facing path, preserving guest details in persisted transcript frames.

Added regression coverage for the provider role, steering envelope, and retained guest attribution.

Fixes #7288
2026-08-01 17:04:00 +00:00
Sunil Srivatsa 8a7edb3f3d fix(coding-agent): preserve explicit extensions in isolation 2026-08-01 12:32:19 -04:00
Harsha Vardhan 98f0c58224 fix(extensions): bundle nested wildcard export subpaths for compiled binaries
The compiled registry enumerated each `exports` wildcard with a single-level
glob and explicitly skipped any key containing a slash, so a nested subpath
like `slash-commands/helpers/active-oauth-account` never entered the bundled
registry. Node matches `*` across `/`, so that import is legitimate: it
resolves from source, then falls through to `Bun.resolveSync` inside a
compiled binary and dies under bunfs. Reproducible on the published 17.2.1
binary with a real extension (`quota-hud.ts`).

Enumeration is now recursive, with every path segment held to the same
private/hidden rules as the leaf, so a `.private/` or `_internal/` directory
is no more exported than a private file. Directory index modules stay
excluded: `./x/*` must not serve `x/y` from `y/index.ts`, which Node would
not resolve either.
2026-08-02 01:14:33 +10:00
roboomp 8f4e58edd2 fix(session): fence session moves without canceling queued rewrites
The move fence bumped #diskEpoch, which no-oped any disk task already queued at the prior epoch (e.g. a header-only ensureOnDisk materializing rewrite), losing explicitly materialized ACP/draft sessions. Gate the append hot path on #sessionFileRelocating instead of a fresh epoch, so prior disk work still drains.

Fixes #7270
2026-08-01 13:56:30 +00:00
roboomp f3fda5139d fix(session): fence flushSync during session moves
A fenced append followed by a Ctrl+C flushSync in the post-rename, pre-repoint window rewrote the full body to the old path, recreating the orphan. Sync rewrites now defer while the session file is relocating.

Fixes #7270
2026-08-01 13:47:58 +00:00
roboomp ea265df009 fix(session): fenced appends during session moves
Prevented synchronous session appends from reopening the vacated source path while moveTo relocates and repoints the journal.

Fixes #7270
2026-08-01 13:39:51 +00:00
roboomp c418662dc2 test(coding-agent): restored context settings after isolation test
Reinstalled the session settings in the regression test cleanup so its competing disabledExtensions cannot leak into later tests.

Fixes #7258
2026-08-01 11:49:38 +00:00
roboomp 55115f4bfd fix(coding-agent): refresh advisor context prompt on reload
Rebuilt advisor runtimes with the rediscovered context files so advisor turns stop evaluating against stale AGENTS.md instructions after /reload-plugins.

Fixes #7258
2026-08-01 11:46:55 +00:00
roboomp 08c80f7da0 fix(coding-agent): scope context rediscovery to session settings
Threaded the session's disabledExtensions into context-file rediscovery so a concurrently-created session's global settings cannot toggle another session's context entries.

Fixes #7258
2026-08-01 11:36:34 +00:00
roboomp 2b268b4d2c fix(coding-agent): refreshed context files on plugin reload
Rediscovered context files from the active session cwd whenever plugin prompt sources refresh, while preserving explicitly preloaded SDK context.

Covered edited and disabled context files in the current system prompt.

Fixes #7258
2026-08-01 11:27:03 +00:00
Kenneth Hoff c3a72e026e fix(memory): mirror off-backend message in ACP /memory stats|diagnose
The TUI's CommandController special-cased backend.id === "off" for
/memory stats|diagnose, but the ACP/RPC slash-command handler in
builtin-registry.ts still fell back to the generic "not available for
the off backend" template — non-TUI users with memory.backend=off saw
the self-contradictory wording this PR was meant to remove.

Extract the shared fallback into memoryStatsUnavailableMessage()
(memory-backend/messages.ts) and use it from both CommandController
and the ACP builtin-registry handler, so the two surfaces can't drift
again.

Addresses review comment:
https://github.com/can1357/oh-my-pi/pull/7251#discussion_r3695383090
2026-08-01 12:12:57 +02:00
Kenneth Hoff 7d0b8cf8dc fix(memory): clarify /memory stats and /memory diagnose message when memory is off
/memory stats and /memory diagnose fall back to a generic
'Memory <action> is not available for the <backend.id> backend.'
message whenever the active backend's stats/diagnose hook is
undefined. For every real backend (hindsight, mnemopi, local) this
reads fine, but the off backend isn't a backend a user picked among
several stats-capable options - it's the no-op state memory falls
back to by default - so the same template renders as 'Memory stats
is not available for the off backend.', which reads as an odd,
almost self-contradictory warning.

Special-case backend.id === "off" with wording that matches the
phrasing offBackend.status() already uses elsewhere ('Memory backend
is off.'), and add a unit test covering both the off-backend wording
and the unchanged generic fallback for a real backend (local) that
simply has no stats hook.

The regression test only asserts on a mocked showWarning call and
never renders Markdown, so it doesn't need a real theme instance;
drop the global dark-theme setup/teardown to avoid leaving the
process-wide theme singleton mutated for later suites in the same
Bun process.
2026-08-01 11:58:50 +02:00
roboomp 52a0af8625 fix(coding-agent): blocked stale revivals after hard kill
A parked revive holds the same AgentRef while constructing a new session.
If the Hub tombstoned that ref before revive completed, the reviver could
still attach its session and set the terminal ref back to idle because
identity alone remained unchanged.

- Made aborted registry refs terminal: reject revival claims, late session
  attachment, and status transitions out of aborted.
- Made lifecycle revival accept only an untouched detached parked ref or the
  exact running session already claimed by createAgentSession; dispose and
  reject every terminal/stale result.
- Added a delayed-revival regression test and claim-before-kill CAS checks.

Fixes #7250
2026-08-01 09:52:09 +00:00
roboomp 57732e9dcd fix(coding-agent): detach hard-aborted refs so ensureLive can't route into a dead session
Preserving aborted refs on dispose exposed a latent invariant break: the
executor's hard-abort path (finalizeSubagentLifecycle) set status `aborted`
and disposed the session without detaching it. With the ref now retained, it
kept a dangling pointer to the disposed session, and ensureLive returns any
non-null ref.session before its revivability check — so hub focus / transcript
chat could route into a dead session.

- finalizeSubagentLifecycle: detach the session before disposing on the
  terminal hard-abort path, upholding the AgentRef invariant (session === null
  when aborted).
- release(tombstone): detach before dispose too (capture the live session
  first), same invariant.
- unregisterUnlessParked: preserve `aborted` refs only when already detached;
  an aborted ref still holding a live session is a bug and is unregistered
  rather than kept reachable.
- Regression test now asserts ensureLive rejects a tombstoned id as terminal.

Fixes #7250
2026-08-01 09:42:41 +00:00
roboomp d350dd8f84 fix(coding-agent): preserve aborted tombstone across live-session dispose
A live-session hub kill did not stick: release(tombstone) awaited the
wrapped session dispose first, and createAgentSession's unregisterUnlessParked
removed any non-parked ref, so the subsequent detach/setStatus no-oped and the
ref was gone — leaving the reopen resurrection for idle/running agents.

- release(tombstone) now marks the ref `aborted` BEFORE disposing, so the
  dispose guard preserves it; the session is detached afterward.
- unregisterUnlessParked now also spares terminal `aborted` refs (matching
  the documented "hard-killed, terminal" retention and finalizeSubagentLifecycle).
- Regression test now uses a session stub that mirrors the real wrapped
  dispose (unregister unless parked/aborted), so it fails if the tombstone is
  set after dispose.

Fixes #7250
2026-08-01 09:34:43 +00:00