Skip to content

chore(opencode): merge upstream v2.3.2 and remove Loom session mirroring - #24

Merged
internetisalie merged 1142 commits into
internetisalie-v2from
upgrade/opencode-2.3.2
Nov 22, 2026
Merged

internetisalie merged 1142 commits into
internetisalie-v2from
upgrade/opencode-2.3.2

Conversation

@internetisalie

@internetisalie internetisalie commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Upgrades the deployed 2.x fork from 2.2.3 to 2.3.2. Retires the mirror API, ownership forwarding and mirror events while preserving ordinary session import/export. Fixes child denial settlement during reload and shutdown.

Stage hold. PoC 5 at d11e4140de passed native async approval/denial, 13/13 Direct V2, 14/14 live Supervisor cases, four materialized dispatch cases and 12/12 persistent PTY cycles on the published digest. Required Linux and native ARM daemon checks passed. The two formal Supervisor matrix commands still require a lead-assigned evidence key, rerun and registration. Foreground subagent compatibility requires owner disposition.

Before rollout: reconcile aggregate schedule, background-job and mirror-owner exposure per environment; verify retired proxy settings are absent; agree recovery method and acceptable write-loss window. Disposable restoration is not operator acceptance of loss. Rollout order: system tests → stage → dev → prod.

Paired UI: internetisalie/openchamber#41 · Locks and receipts: https://gitea.internetisalie.net/loom/opencode-stack-tests/pulls/48

Review round 4 (PASS) and its post-PASS fixes. Reviewed head 43e089abcb, fixed head 3e5666aee3. Dispositions:

  • P1 (LOW): fixed in part. The restart sweep wakes a parent whose last turn did not fail (succeeded, user-interrupted or never idle). The remainder, a parent that failed for a reason other than the restart budget, is not revived: that is the code's stated intent, so it is ruled out.
  • P2 (LOW): fixed. Two tests: a user-interrupted parent holding a subagent notice is woken, and an idle parent whose steer notice is not a subagent report stays parked.
  • P3 (NIT): fixed. The duplicate Deferred.succeed(release) is removed.
  • P4 (NIT): fixed. The query is SessionInbox.subagentNoticeSessions in inbox.ts, called from restart.ts.
  • P5 (LOW): about the stack-tests evidence archive of Adding "ignore folder" configuration anomalyco/opencode#48, not this change, and changes nothing going forward; ruled out.

jlongster and others added 30 commits November 12, 2026 13:45
Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
…ss image previews are on (anomalyco#63577)

Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
…me (anomalyco#63220)

Co-authored-by: ssskay <ssskay@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: R44VC0RP <89211796+R44VC0RP@users.noreply.github.com>
rekram1-node and others added 16 commits November 17, 2026 21:31
@internetisalie

Copy link
Copy Markdown
Owner Author

Remediation at 67a99f3d49: expanded Linux fork CI passed, including native plugin fixtures, CLI service/lifecycle, global roots, migration and PTY suites. Clean Ubuntu canonical check and all 35 typecheck tasks passed. Previous docs and ARM macOS checks were cancelled rather than proven. A disposable baseline-to-PoC-1 rehearsal kept active and paused schedules, omitted finished, conditional-if, conditional-until, counted, missing-session and missing-due fixtures, and preserved session history across upgrade and restart. This is not approval for data loss. Per-environment read-only counts, operator disposition, and matched-pair recovery proof remain gates. PoC 2 is tagged for fresh qualification.

@internetisalie

Copy link
Copy Markdown
Owner Author

Qualification hold on 06d29b9312 (PoC 3). All 302 session execution/runner tests passed on a leased Linux VM, including ordinary decline and independent shutdown recovery. A subsequent source review identified two uncovered orderings: an accepted denial followed by Location reload during settlement, and owner shutdown before the denial reaches the execution coordinator. Synchronized real-runner tests are assigned for both. Acceptance requires no continuation or handoff after denial, claim release, one durable parent cancellation, and continued recovery when teardown occurs without denial. Tag publication alone does not clear stage.

@internetisalie internetisalie left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of d11e4140de — verdict: approve for merge

Merging is not stage promotion: the stage hold in the description stands, and the rollout conditions below are not met by this PR.

Method. Compared the fork-only delta of the candidate (v2.3.2..d11e4140de, 75 files, +2917/−112) with the fork-only delta of the previous fork (v2.2.3..v2.2.3-internetisalie.2, 87 files), then read the three session commits (06d29b9312, cb61c8967a, d11e4140de) and the mirror removal (c5677c9625) in full. Static review plus CI; I did not run the suites locally.

Focus areas

Child permission denial — sound.

  • A user reject fails the wait with Permission.DeclinedError(); a service close fails it with DeclinedError({ shutdown: true }) (packages/core/src/permission.ts:161,254,277 vs :339,353). The step classifies each decline from that marker instead of from isLocationClosed() at settlement time (packages/core/src/session/runner/step.ts:188-194), so a reload that overlaps settlement can no longer relabel an accepted denial as a shutdown and continue the model.
  • A user decline ends the step with StepDeclinedError (step.ts:330). Recovery, overflow compaction and retry are all gated on declines.length === 0 (step.ts:207,247,255), so nothing re-issues the request after a denial.
  • SessionExecution settles it as interrupted / user: the job is cancelled, the claim released and one cancelled report reaches the parent (packages/core/src/session/execution.ts:51-57,171-181).

Shutdown and recovery — sound.

  • The declined latch (execution.ts:112,131,171) covers an owner interrupt replacing the typed exit after masked settlement. It is set only on a path that always ends in StepDeclinedError, and consumed by the one settled hook per busy period; the run coordinator does not loop after a failed drain, so it cannot leak into a later execution.
  • A shutdown-flagged decline keeps upstream behaviour: Completed({ needsContinuation: true }) when the Location is closed (drain returns Reloaded), otherwise an interrupt that keeps the claim (step.ts:332-337). LocationLifecycle.shutdown sets closed before permission.close, so the second branch is defensive.

Asynchronous child completion — sound. SubagentJob, SubagentReport and job.ts are upstream v2.3.2 unchanged. The only fork change on that path is the terminal classification above.

Mirror removal and ordinary import/export — preserved.

  • packages/core/src/session/transfer.ts, session/store.ts, packages/server/src/handlers/session.ts, packages/protocol/src/groups/session.ts, groups/permission.ts, packages/schema/src/session-event.ts, packages/server/src/event-feed.ts, fetch.ts, process.ts, options.ts and packages/server/test/session-import.test.ts are byte-identical to upstream v2.3.2 at head. Import/export is upstream's code path with nothing of the fork left in it.
  • No reference to the mirror route, remoteProxy, OPENCODE_REMOTE_PROXY_*, SessionOwnership or session.mirror.updated remains under packages/.
  • The fork migration keeps its slot (20260926002438_project-association at m48); the four upstream migrations added since 2.2.3 all sort after it.

Evidence I could check

  • Fork CI linux-server passed on d11e4140de; it runs session-execution.test.ts, session-runner.test.ts, database-migration.test.ts and session-import.test.ts.
  • ghcr.io/internetisalie/opencode-stable:v2.3.2-internetisalie.1-poc.5 resolves to sha256:7e4319e1…f6acf and carries revision label d11e4140de….
  • The tests added by the fixes drive the real runner through reject-then-reload, reject-then-owner-interrupt, Location teardown and Permission-only teardown (packages/core/test/session-runner.test.ts:5628-5835) and assert request count, claim state, execution events and the parent notice.

Not blocking — follow-ups

  1. Question dismissal has no shutdown marker. step.ts:191 falls back to locationClosed for QuestionTool.CancelledError. A user dismissal followed by a Location reload before settlement is recorded as "the location shut down" and the model continues after the reload — the ordering cb61c8967a fixed for permissions. Carry a marker from Form.close the same way.
  2. terminal() lets the latch outrank every exit (execution.ts:52). A defect raised after onDecline would be reported as a user interruption. Not reachable today; check the latch after the success and defect branches, or log the discarded cause.
  3. Legacy mirror-owned rows. The old guard (store.isMirror in execution.ts at 2.2.3) is gone and nothing replaces it: a 2.2.3 database row with event_sequence.owner_id = 'mirror:<source>' is an ordinary executable session at head. Safety rests on the storage gate in opencode-stack-tests, which its own kit says is not installed in any environment (docs/paired-upgrade-qualification.md:213). Rollout condition, as the description already says.
  4. Qualification figures in the description (13/13 Direct V2, 14/14 Supervisor, 12/12 PTY cycles, async approval/denial on the published digest) are not backed by any committed artifact I could read. See the review on https://gitea.internetisalie.net/loom/opencode-stack-tests/pulls/48.

Not examined

Upstream code between 2.2.3 and 2.3.2; fork changes outside the four focus areas beyond a patch-equivalence check (project association, plugin HTTP routes, persistent PTY, global roots — across the merge their patches are unchanged, differ only by the mirror removal, or are test fixtures); the retained evidence archive.

@internetisalie

Copy link
Copy Markdown
Owner Author

New integration evidence on the reviewed PoC 5 digest: when the server accepted a child permission rejection (HTTP 204) and was then stopped, the denied tool and interrupted child state survived restart, but the test did not observe the parent cancellation notice. This reproduced twice. Five other async cases passed, including reject then reload and teardown with permission pending. The earlier make test-stack run did not compile this tagged test. Investigation is checking durable storage versus notice consumption or observation; product attribution is still open.

internetisalie and others added 2 commits November 21, 2026 13:44
…ore shutdown

A subagent's cancellation notice can be admitted to the parent inbox before the parent takes an execution claim. When shutdown lands in that gap the outbox row is retired and nothing wakes the parent after restart. Restart now finds idle, succeeded parents with an admitted steer notice from a subagent and wakes them once recovery finishes. Parents the restart budget already failed are left alone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ast outcome

The restart sweep woke only parents whose last turn succeeded, while the
normal report path wakes the parent regardless. The sweep now skips only a
parent whose last turn failed, which the restart budget uses to leave its
notices parked. The inbox query moves into SessionInbox, and a test covers
the non-subagent source filter.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@internetisalie
internetisalie merged commit d80874c into internetisalie-v2 Nov 22, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.