Commit graph

13 commits

Author SHA1 Message Date
Pascal André
16428ad927
test(pruning): expect response usage to keep tool steps in one group (#1074)
test(pruning): expect response usage to keep tool steps in one group

#1059 changed the transcript's token lines from one per model step to one
per agent response. Steps that end with tools now pass their usage on to
the response text, so no line separates them and their tools stay in one
technical group. The native pruning UI scenario still expected the old
behaviour: it waited for visible per-step usage to split the last tool
group ("Shell: 2"), then hid usage to join it. That wait times out, and
tests-session-pruning-native has failed on every OS for each pull request
since #1059 (including #1059 itself).

The step now checks the new contract on the real native transcript. With
usage visible, the response's conclusion carries its usage line, the two
tool-only steps carry none, and their tools form a single "Shell: 3"
group across both messages. The rest of the scenario (whole-group,
cross-message response, reasoning-group and whole-session cleanup) now
runs with usage visible, the default, instead of hidden. Product code is
unchanged.

Validation: node scripts/run-session-pruning-native.mjs <cli> --ui against
an isolated @opencode/cli 2.1.2 on Windows passes every native and UI step,
including the updated one.
2026-10-21 12:40:03 +02:00
Pascal André
b818a28c3d
test(pruning): align native UI journey with token grouping (#1040)
## Cause and correction
Native pruning CI timeout on all three OSes was a fixture mismatch:
visible per-step token usage splits technical groups, but the journey
still expected the second cross-message prune request. It reproduces on
BOTH OpenCode 2.1.0 and 2.1.1.

Assert the visible grouping boundary, then explicitly hide message usage
before testing cross-message cleanup. Use immutable config fixture
responses so Solid updates. Add SSE/HTTP replay-metadata parity
assertions to the existing native fixture.

## Validation
- Base native UI journeys timeout on 2.1.0 and 2.1.1; corrected complete
journeys pass both (completed:true).
- UI tests 97/97; server pruning/broker tests 21/21; UI/server
typechecks and diff check pass.
- Local Windows only; Linux/macOS CI acceptance still pending.
- The two reported metadata unit failures are from stale local client
2.0.27; they reproduce with that dependency and pass unchanged with
lockfile client 2.1.0. No metadata or contract workaround introduced.
- No production code, guard, timeout, dependency pin or shared
app/daemon/state changed.

Largest changed file ~428 lines.
2026-10-20 19:37:16 +02:00
Pascal André
5dd8150f62
test: stabilize three intermittent CI failures on dev (#941)
## Summary

Stabilizes three tests that failed intermittently on recent PR runs
regardless of the change under review (including #786 and others). Each
failure came from the test harness, not from product code; no product
code changes.

- **Session pruning UI (Windows):** header actions take pointer events
only while their message is hovered or focused, and the virtualized row
can be replaced while scrolling into view. Playwright's click then hit
`.message-item-header-row--top` and retried without re-hovering until
timeout (`test-session-pruning-ui.mjs:192`). The response cleanup action
is now activated from the keyboard only while the live button holds
focus, transient detachment is retried, and Enter is never pressed once
the confirmation dialog is visible.
- **`mission-native-family`:** `timeline-previews.ts` deliberately
aborts optional `outlinePreview` requests whenever the requested marker
set changes within the same session. The test counted such aborts as
failures unless the active session had changed; they are now recorded as
superseded reads. Full `outline` reads keep their stricter rule.
- **`family-authority-identity-fence` (server):** Git 2.46+ detaches
automatic maintenance after commits; its late trace2 `exit`/`atexit`
events (child session of the commit) landed in a trace the test had just
cleared to prove a fence is process-free. The test's Git invocations now
disable automatic maintenance and gc.

## Context

Recent `dev` merges went in with failing `tests` jobs: an earlier
failing step (for example `Test server`) skips the browser step, so new
browser failures stayed hidden. The `git-history`, `panel-extensions`
and `project-git-lifecycle` breakages were already fixed by the test
commits in #940; this PR addresses the remaining intermittent ones.

## Validation

- Pruning UI runner: 3 consecutive local passes with an isolated
official OpenCode 2.0.28 runtime. The first draft of this fix failed
deterministically on detachment, confirming the race locally.
- Identity fence suite: 5 consecutive local passes (the Linux Git
maintenance race itself is confirmed by CI).
- `mission-native-family`: 11/11.
2026-10-14 10:58:24 +02:00
Pascal André
34ad2fbeb5
fix(plugins): wait for plugin registration before the first plugin RPC (#925)
## Summary

On the first seconds after a CodeNomad start, the timeline could show
"Timeline unavailable" (the full index read failed) until a manual Retry
or session switch. The OpenCode log shows every bundled-plugin refusal
(HTTP 400 on `/api/rpc/codenomad.session-pruning/*`) 3–4 s after a
backend start, and never otherwise (10/11 10:45 and 22:43, 10/12 18:10).

Cause: the bundled plugins register their RPCs only while a backend
presence lease exists, and check presence every 2 s
(`desktop-plugin-presence.ts`). A stopping backend removes its lease, so
the plugin unregisters; a new backend writes a lease, but the plugin
only notices at its next check. A backend RPC in that window is refused,
and the route reports it as unavailable. The timeline index is simply
the first such call.

This PR fixes the ordering rather than retrying refused reads:

- **Plugin side.** Each presence follower records which
current-namespace leases it has observed while registered. Once every
follower of that directory in the native process (one per loaded
Location) has done so, a `<lease>.ready` marker is written beside the
lease. Marker IO stays outside the serialized reconciliation, so it
never delays or swallows a presence check. Read-only legacy namespaces
are never written. Observations move to a v2 shared map (lease names);
older bundle copies keep their v1 map.
- **Backend side.** After writing its lease, the backend waits for that
marker (local file check every 100 ms, bounded to 8 s, never rejects;
disposal ends the wait and removes the marker with the lease).
`DesktopPluginLifecycle.ready()` exposes the current installation's
readiness and `WorkspaceManager.desktopPluginsReady()` forwards it.
- **Routes.** Every bundled-plugin RPC caller awaits
`desktopPluginsReady()` before its first call: timeline/history
navigation, history, pruning batches, pruning, panel extension assets
and the pending-request snapshot (which otherwise took the refusal as
"unsupported"). Pruning routes wait before entering the worktree
deletion fence, so the wait never holds it. After the bounded wait the
call proceeds and its real result is reported, so an actual failure
stays visible.

## Validation

- New `desktop-plugin-readiness.test.ts`: readiness after registration
and marker cleanup on stop; no marker while a follower is still
registering; no acknowledgement without presence and no writes to an
older backend's directory; readiness settles at once when the backend
stops first. Negative control (marker acknowledgement disabled): the two
readiness tests fail.
- Route regression: a timeline read does not call the plugin until
readiness settles.
- Existing presence, installation, lifecycle, automation, missions,
pruning installation, pending snapshot and route suites pass, including
the strict shared-scan counts. A first version awaited marker IO inside
reconciliation and made the missions presence tests time out; marker IO
is now detached.
- Server typecheck; plugin bundles build (pruning, automation,
missions).

## Notes

- Scope is the bundled pruning plugin's RPCs (timeline, history,
pruning, panel assets, pending snapshot). Missions and automation follow
the same presence contract and also receive markers, but no extra
backend gating is added for them here.
- The recurring "Question and permission recovery is incomplete" warning
is a separate issue (captures show complete 200 responses and no plugin
refusal around it) and will be handled in its own PR.
2026-10-13 00:50:58 +02:00
Pascal André
0983db3c30
fix(ci): stabilize Windows native tests and artifact comments (#828)
Stabilize the Windows pruning/UI CI harness by loading its unchanged UI dependencies before the long native/SQLite preamble. The late-import baseline reproduced locally under CI's Node 24.20.0 with native status 0xC0000374. This is a qualified import-order workaround, not attribution or repair of the underlying heap corruption; no assertions, dependencies, test skips or retries change.

Retain actual child exit status/signal, stdout/stderr, durable stages and synthetic fixture logs through a parent runner. Require explicit completion as well as exit zero, and upload parent/fixture diagnostics on failure. Preserve the original UI scenario exception if diagnostic capture fails.

Trigger artifact announcements from validation completion rather than bounded polling. Failed validation stays red in its own workflow. Run only trusted default-branch helper code, verify the originating workflow and current authorized PR head, use GitHub commit association when needed and update only bot-owned marker comments. Artifact names remain escaped display text, never executed contents.

Fifteen focused tests pass under Node 24.20.0. Two coordinator-run and one independent full Windows native/UI scenarios complete naturally with all original assertions, restart persistence and presence cleanup. YAML and diff checks pass. The published independent gatekeeper review of this exact head has zero findings.

Admin merge is explicitly requested without waiting for CI. GitHub workflow_run delivery needs post-merge confirmation; no universal CI reliability, underlying heap repair, Linux/macOS native rerun, installed app replacement or shared daemon restart is claimed.
2026-10-02 11:24:27 +02:00
Pascal André
824d94dabd
chore(opencode): qualify and recommend stable 2.0.19
Align server/UI client and bundled plugin pins with OpenCode 2.0.19 while retaining the demonstrated 2.0.7 timestamp minimum. The authenticated native schema and published declarations preserve the consumed API contract; runtime improvements concern compaction, context limits, provider cache affinity and Shell conventions.

Extend setup version coverage and update the maintained compatibility and architecture references. Add per-import native/UI fixture diagnostics after late Vite loading stopped on both the new runtime and the 2.0.18 control; do not claim that eager-import diagnostic acceptance fixes that failure.

Qualify both minimum/current native runtimes, historical migrations, isolated npm upgrade without daemon restart, standalone plugin installation, UI/browser behavior and production bundles. Retain the original Windows fixture failures and their bounded diagnostic results in the PR evidence.
2026-09-29 13:44:20 +02:00
Pascal André
ea3aeb9e3e
fix(opencode): qualify 2.0.15 and preserve generated proxy URLs (#752)
Validation includes isolated minimum/current native suites, historical migrations on Linux/Windows/macOS, targeted unit and browser tests, production builds and two independent gatekeeper reviews with zero actionable findings. Retain startup diagnostics for an unexplained intermittent Windows pruning/UI process exit; the complete instrumented Node 24.20.0 rerun passes locally. Known system-message search fixture timeouts remain documented. Admin merge explicitly requested; runtime activation and desktop installation remain separate actions.
2026-09-23 12:56:03 +02:00
Pascal André
6a77f41531
merge(dev): resolve history search integration before PR 723 merge
Integrate the current dev baseline while retaining PR 723's server-backed full-history search and direct navigation. Resolve the sole message-section conflict by keeping the bounded history query flow instead of reinstating the superseded resident-page traversal and resident-result reconciliation.

Preserve dev's system-message visibility and untracked search locator changes. Validate UI and server typechecks against the updated locked dependencies, plus browser regressions for restored checkpoint reconciliation and current-session search navigation.
2026-09-20 23:52:50 +02:00
Pascal André
ca94224b74
fix(opencode): align current contracts and fence native message settlement (#728)
Align the server/UI OpenCode client and bundled plugin at 2.0.11. Route canonical server.info through authenticated discovery, preserve legacy step timing, and honor hidden Forms protocol fields without rendering their inputs or dropping defaults.

Reconcile terminal tools into the bounded visible transcript and fence native reducer history reads against intervening events. Discard stale pages and coalesce trailing reads so a late settlement snapshot cannot remove a newer streaming assistant. Preserve lifecycle, generation, disposal, location and historical-data safeguards.

Qualify the latest stable runtime in CI and record the resolved version. Each CodeNomad release fixes its minimum supported OpenCode version to the latest stable available when that CodeNomad release ships. Keep one shared compatibility reference and detailed evidence in PR/CI history rather than per-version reports.

Validation includes isolated native runtime/proxy/pruning, automation, environment and fork acceptance; hidden Forms browser coverage; deferred settlement/new-execution regressions; 112 final targeted UI tests, typechecks and production builds. Gatekeeper findings were fixed and independently re-reviewed before merging.
2026-09-20 13:48:53 +02:00
Pascal André
009a0aaf29
fix(history): preserve manual timeline browsing during pending jumps
Cancel deferred active-marker reveals when the reader scrolls or interacts with the global rail, and reveal without a smooth animation. A previous selection must not move or unmount the next click target while its distant window is still loading.

Extend the Chromium latest-intent regression to keep the next destination visible beyond the reveal delay. Update the isolated native pruning UI fixture to proxy history routes and provide the same service-location inventory used by whole-session cleanup.

Validated all five browser navigation cases, the UI typecheck, packaged-resource smoke checks, and the complete isolated OpenCode 2.0.5 native/UI pruning fixture, including whole-session confirmation and persistence after reload.
2026-09-20 13:05:28 +02:00
Pascal André
bdac05bb25
fix(environment): refresh profile variables before each prompt (#714)
## Summary

Apply the existing CodeNomad profile environment **before every prompt,
custom command and session-shell send**, then forward the request only
after OpenCode acknowledges it. This makes profile changes available to
local commands even when the shared daemon is already running.

No per-conversation settings UI, polling, session-opening writes or
daemon restart. The implementation lives in the shared server for
Electron/Tauri/web parity.

close #711; awaiting reporter validation rather than automatically
closing the issue.

## Implementation

- Build a complete execution-host snapshot; preserve PATH and other
inherited values, normalize Windows key collisions, and exclude internal
authentication/storage variables. WSL reads its selected distro's
environment instead of sending Windows PATH/HOME.
- Apply after ownership checks and worktree mutation admission, using
the pinned native connection. Fail the send on environment errors, stale
connection or disconnect; never log the native environment request body.
- Update help and failure messages in every locale. Changes and removals
take effect on each conversation's next send.

## Validation

- Server suite: **586 passed, 2 platform skips**.
- Focused UI send/SDK/authority tests: **112 passed**.
- Server, UI and Electron typechecks; production UI build passed.
- **OpenCode 2.0.9 / Windows native fixture:** real WorkspaceManager +
guarded proxy + native shells, two conversations, changes/removal, no
mutation on read, Git Bash, unchanged daemon PID. Independent
configuration/database/port; only the fixture service was stopped.
- Reproduction: `node scripts/test-session-environment-native.mjs
<absolute-opencode-executable>`.

## Scope

This changes local session command environments, not provider/MCP/LSP
configuration or daemon-internal temporary files. The native environment
belongs to a session: another client or a new send during existing work
can replace it. Queued prompts do not get individual snapshots, and
native-created subagents are not automatically intercepted. Details:
`dev-docs/SESSION_ENVIRONMENT.md`.

Existing oversized files touched narrowly:
`packages/server/src/server/http-server.ts` (~2,300 lines),
`packages/server/src/workspaces/manager.ts` (~1,200 lines), and
`packages/ui/src/lib/i18n/messages/*/settings.ts` (~600 lines each).
2026-09-19 18:18:56 +02:00
Pascal André
aa51cbb9ff
fix(opencode): support earlier and modern V2 runtime contracts (#695)
Closes #694

## Status

This PR contains the stable 2.0.4 client migration, authenticated V2
discovery fallback and shared cross-runtime compatibility
implementation. The validation results below are local execution
evidence; the newly added CI matrix must also run on the updated PR
head.

## Published changes

- Pin UI/server to official `@opencode/client@2.0.4` and the bundled
pruning plugin to `@opencode/plugin@2.0.4`, with the corresponding
lockfile migration.
- Probe authenticated `/api/status` first. Fall back to earlier V2
`/api/health` **only on HTTP 404**, retaining the endpoint, credentials,
64 KiB response bound and absolute deadline. Authentication, transport,
server and malformed-status failures do not trigger fallback.
- Migrate the canonical UI/server contract to stable Forms, permission
decisions, command names, interrupts, renaming, forks, message lookup
and inbox delivery.
- Update the guarded proxy for stable methods/paths, native
active-session envelopes, native `cursor.next`, global Form directory
headers and current resource/plugin events.
- Follow the renamed upstream platform binary `bin/opencode(.exe)` while
retaining public CLI aliases.

Discovery success alone does not establish compatibility with an earlier
runtime's conversation APIs.

## Shared cross-runtime compatibility

### Shared cross-runtime integration

- Introduce one connection-scoped adapter under
`packages/server/src/opencode/compatibility/`, used by both the guarded
UI proxy and direct server callers, including Yolo.
- Select the contract using authenticated daemon identity rather than
the CLI executable's version. Recognize unknown publications through
authenticated, bounded OpenAPI negotiation instead of an exact
runtime-version gate.
- Bind authorization, client, transport and profile to one connection
generation. Fence actual mutation dispatch after asynchronous body
preparation; prevent late old streams from publishing or invalidating
their replacement.
- Translate earlier V2 routes, methods and payloads before sending.
Never retry a mutation speculatively after 400, 404, authentication or
transport failures.
- Normalize legacy HTTP inbox timestamps, including compaction
admission, before the pinned Solid reducer. Preserve the distinct native
SSE inbox schema and durable event metadata.
- Restore legacy catalog/content invalidation and permission-event
convergence. Preserve meaningful method/path/status/profile diagnostics
and native 401 error envelopes.

### Location authority and pruning

- Preserve legacy workspace identity internally through request
serialization, catalog/cache keys, Forms, imports, cursors, events and
exact move rollback. Modern public APIs continue to reject obsolete
workspace selectors.
- Authorize complete locations before translating directories or
synthesizing upstream Form/location headers. Keep native cursor tokens
unchanged.
- Preserve session/path ownership, worktree mutation fences and the
restricted proxy allowlist. Generic RPC, plugin management and
destructive revert commit remain blocked.
- Carry verified legacy identity through pruning membership checks,
preview and the existing transactional storage/claim fence; do not relax
deletion checks.
- Treat native idle records as control records, retaining
identity/outcome without fabricated assistant text.
- Add a common multi-runtime CI matrix and the audit/evidence register
in `dev-docs/OPENCODE_V2_COMPATIBILITY.md`, including preserved
historical architecture findings.

## Local validation

All native tests use isolated synthetic daemons, configuration and
databases, never the shared daemon or user storage.

| Check | Result |
| --- | --- |
| Same native suite on beta-19271, 2.0.3, 2.0.4 and 2.0.5 with pinned
client/plugin 2.0.4 | Passed |
| Full native pruning suite with non-null legacy workspace identity on
beta-19271 and 2.0.3 | Passed |
| Rendered UI on modern 2.0.5 and beta-19271 with non-null identity |
Passed |
| Native 2.0.5 suite inside Ubuntu/WSL, using a temporary Linux
filesystem root | Passed |
| Server tests (after CI follow-up) | 500 passed, 2 skipped |
| UI store tests | 441 passed |
| Electron native tests | 194 passed, 4 skipped |
| UI/server/Electron typechecks | Passed |
| UI/server and Electron production builds | Passed |
| Windows Tauri release executable (`--no-bundle`) | Passed |
| Electron/Tauri packaged-resource smoke checks | Passed |
| Desktop packaging invariants | 4 passed |
| `git diff --check` | Passed |

The native matrix exercises the actual shared connection, generated
client, UI fetch adapter and guarded proxy: voice-off/on instructions,
prompts, commands, session Shell, background Shell output
cursors/removal, UI/Yolo permission acceptance and rejection, busy inbox
delivery/cancellation, interrupt/wait, staged revert clearing,
session/global/worktree Forms, native pagination, export/import,
same-directory legacy identities, scoped events, foreign authority
refusal and exact rollback.

Pruning coverage includes actual storage identity and execution claims,
busy refusal, idempotency, competing admission, next-model payload, fork
isolation, pre-compaction history, restart, backend presence
disposal/reopening and crash expiry. Rendered tests cover
individual/group/response/session cleanup, confirmation counts,
persistence and reload.

## Autonomous gatekeeper review

Review/fix/retest loops concluded with no remaining actionable findings
in the reviewed transport/lifecycle/proxy,
identity/UI/events/pruning/rollback, scripts/CI and rendered-fixture
scopes.

Corrections included dispatch-generation races, compaction admission
normalization, independent negotiation cancellation, first-request
profile resolution, preservation of streamed 401 envelopes and direct
Shell/PTY identity propagation. A final rendered failure was traced to
the fixture awaiting only the first RPC of a cross-message deletion; the
fixture and regression now await every affected message. Production
deletion guards were not relaxed.

This scoped approval does not close the separately preserved historical
architecture findings.

## Validation boundaries

### CI follow-up

The first run on `a0c1c943`
([35142559235](https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/35142559235))
failed in five native jobs. The local bundle tests had missed the
standalone npm archive's missing sibling import, and Windows legacy jobs
exposed a short-path versus canonical-path project comparison. The
dependent artifact-comment job reported that same build failure.

The follow-up makes the plugin's identity primitives self-contained,
adds an isolated npm-file-list regression for all exported entrypoints,
and corrects project identity selection with alias and nested-repository
regressions. The packed-plugin failure was reproduced before correction;
the corrected installed package passes the native suite on Windows 2.0.4
and Linux/WSL 2.0.4/2.0.5. The corrected 2.0.4 shipped bundle also
passes rendered/native pruning. Fresh full beta-19271 and 2.0.3
`--legacy-pruning` suites pass under a reproducing Windows short-path
TEMP root after the final exact-directory fix. Independent final reviews
approve packaging/documentation and worktree identity with zero
actionable findings. Remote checks on the new head remain the CI
authority; these are local follow-up results.

- Full interaction with the installed desktop application through
Developer Mode was not verified because Developer Mode is inactive. The
release executable and packaged-resource checks above are build/smoke
evidence, not a fresh-install interactive certification.
- Remote run
[35146390688](https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/35146390688)
at `486e856d` passes all runtime-contract jobs, Windows/Linux native
pruning, service compatibility, general tests and both Tauri checks.
macOS passes packed-plugin loading/pruning, then times out on late
bundle discovery. The fixture now canonicalizes its root before daemon
startup to align `/var` configuration paths with `/private/var` FSEvents
paths. Late installation remains mandatory and asserts the plugin was
initially absent; failures now upload isolated diagnostic
logs/inventory/captures. Actual macOS confirmation remains pending on
the new head.
- Interactive native TUI validation was not performed.
- The passing WSL result is Linux-native execution inside WSL, not a
complete Windows-host/WSL desktop traversal. With the fixture's
configuration directory under `/mnt/c`, conversation/proxy checks passed
but late plugin discovery timed out; the otherwise equivalent
Linux-filesystem run passed. Mounted-configuration late discovery
remains a documented environment limitation.
- Other audited publications are declaration-reviewed, not individually
native-certified. The four-runtime matrix does not imply universal V2
compatibility.
- Earlier PR artifacts do not contain the completed cross-runtime
implementation; use artifacts built from the updated head. Local passing
results do not imply that the updated remote CI has completed.
2026-09-16 23:48:08 +02:00
Pascal André
ea37f97bea
feat(pruning): restore opt-in selective deletion through native plugin RPC (#686)
## Summary

Restore selective deletion of completed assistant tool/reasoning content
after OpenCode removed `session.messageUpdate`, without forking OpenCode
or opening a generic RPC proxy.

The original draft's unconditional `maintenance_required` stub is
replaced by a working **experimental, explicit opt-in** plugin path for
the audited `0.0.0-beta-19419` runtime. The default remains read-only.
Unknown runtimes/storage and active native execution fail closed.
Nothing is installed or enabled on app startup.

## Implementation

- Keep individual/message/group/session cleanup entry points. Send
selected technical indices and a canonical SHA-256 revision, never
arbitrary replacement content, SQL, database filenames or
caller-selected locations.
- Use an ownership-checked CodeNomad broker with a fixed RPC
ID/method/location and worktree-deletion fence. Keep the removed PATCH
and generic RPC routes blocked.
- Bind the plugin's explicitly configured database connection to the
actual daemon DB with a fresh `ctx.storage` challenge. Inside a
synchronous SQLite write transaction, recheck
directory/project/workspace ownership, native durable execution claim,
staged revert/compaction state, event ownership and retained payloads.
- Rely on the audited native **write-ahead execution claim before runner
history reads**, not an `idle` check, plugin mutex or `BEGIN IMMEDIATE`
alone. Never set or release the native claim ourselves.
- CAS only the completed assistant's content array. Preserve IDs,
ordering, text, snapshots, usage and metadata. Commit a content-free
idempotency receipt atomically with the change; identical retries cannot
delete a second shifted block.
- Emit the custom invalidation after commit. Re-read via the native API,
invalidate the SDK transcript and pending rotations, and fence late
reads against newer invalidations. Add a public-API TUI cache companion
and reconnect handling.
- Correct native Windows path encoding; support more than 4,096 selected
parts within explicit request/message budgets.
- Provide an independently packable plugin with main and `./tui`
entrypoints, deployment/safety docs, and a Windows/Linux/macOS native
package CI matrix. Plugin installation remains manual and separately
approved.

## Validation performed locally

| Check | Result |
|---|---|
| Server/plugin/SQLite/broker/proxy tests | 72 passed |
| UI actions, events, SDK projection and stale-read tests | 60 passed |
| Plugin/SQLite/TUI-companion tests under Node 22 | 30 passed |
| Server and UI TypeScript checks | Passed |
| Production UI build | Passed; existing large-chunk warnings |
| Official Windows x64 beta-19419 executable | Passed on a private
daemon and generated DB |
| Independently packed and installed plugin | Same native test passed,
outside the checkout |

The native integration test uses the real beta-19271 network client
against the official beta-19419 runtime, with a local synthetic provider
and no credentials. It verifies actual preview/prune RPC, refusal while
a primary generation holds the native claim, both prompt/transaction
orderings, idempotent retry, two event subscribers, native re-reading,
the subsequent primary model payload, fork isolation, pre-compaction
history without summary changes, and persistence after server restart.

The new three-OS native CI matrix must pass on this head before merge.
No CI result is inferred from the local Windows run.

## Boundaries and remaining validation

- This is a reviewable opt-in implementation, **not general availability
across OpenCode versions/providers/platforms**. Exact runtime gating is
intentional; don't widen it without re-auditing/testing.
- Interactive official TUI, two native CodeNomad windows/scroll
behavior, WSL, provider-specific continuation state and budget/token
estimates are not claimed as validated. TUI companion tests use its
cache contract, not an interactive terminal. Two HTTP subscribers are
not two GUI windows.
- Existing bulk cleanup is per-message and reports failure counts;
dedicated installation/capability and bulk progress/cancel UI are not
added here.
- Existing summaries/native checkpoints, fork copies and already
assembled/sent requests are not retroactively scrubbed. Historical usage
remains historical usage; mock token values are not a token-savings
measurement.
- This changes persisted V2 content, not only visibility. It frees
reusable SQLite pages but does **not** promise a smaller physical file.
No VACUUM, V1 cleanup, durable-event rewriting, automatic backup
restoration or universal repair is included.
- No active user DB was changed, no shared-daemon plugin installed, no
shared OpenCode service stopped/upgraded, and no native desktop
executable/profile rebuilt or replaced. Tests use isolated synthetic
data only.

## Documentation

- [Request flow and validation](dev-docs/SESSION_PRUNING_RPC.md)
- [Audited safety boundary](dev-docs/SESSION_PRUNING_SAFETY.md)
- [Explicit deployment and
recovery](dev-docs/SESSION_PRUNING_DEPLOYMENT.md)

References: anomalyco/opencode#44984, anomalyco/opencode#48043,
anomalyco/opencode#48090 and the maintainer's plugin/RPC direction. No
upstream API or distribution fork is introduced.
2026-09-10 13:31:40 +02:00