GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(opencode): local LAN provider discovery + auto-discover models by androidand · Pull Request #27554 · anomalyco/opencode

feat(opencode): local LAN provider discovery + auto-discover models #27554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
androidand wants to merge 10,000 commits into anomalyco:dev from androidand:dev

Uh oh!

There was an error while loading. Please reload this page.

Closed

feat(opencode): local LAN provider discovery + auto-discover models #27554

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
10000 commits
Select commit Hold shift + click to select a range
bf5bf36
feat(go): add Gemini 3.7 Flash (#42390)
Aug 13, 2026
1b2a23c
chore: generate
Aug 13, 2026
d3c09dd
fix(go): remove Gemini 3.7 Flash (#42393)
Aug 13, 2026
8dc0873
chore: generate
Aug 13, 2026
e722411
chore(specsync): check in the tracker ref cache
Aug 13, 2026
486bf1d
fix(task): publish the child session id before placement probing
Aug 13, 2026
438c1c8
fix(log): migrate 5 fork files off the deleted core/util/log shim
Aug 13, 2026
38575ce
fix(opencode): preserve v1 database compatibility (#42444)
Aug 14, 2026
149a889
fix(boot): LayerNode.make() positional-args mismatch broke server sta…
Aug 14, 2026
2e34fdf
docs: sort Gemini 3.7 before 3.6 (#42473)
Aug 14, 2026
d613cca
chore(deps): update ai-gateway-provider to 3.2.0 (#42488)
Aug 14, 2026
7ab2ec1
chore: update nix node_modules hashes
Aug 14, 2026
95d76c5
docs(zen): add Muse Spark 1.2 (#42508)
Aug 14, 2026
9799f41
chore: generate
Aug 14, 2026
eeafb44
feat(go): add GLM 5.3 (#42518)
Aug 14, 2026
fa922eb
fix(mcp): restore the interface parity the 2.0 migration dropped
Aug 14, 2026
8be8178
fix(mcp): finish interface parity — typecheck clean, MCP suite green
Aug 14, 2026
355204c
feat(fork-verify): fail on unregistered divergence from upstream
Aug 14, 2026
e5f474e
perf(test): dispose each test's instance instead of holding it for th…
Aug 14, 2026
616559b
fix(prompt): put MCP server instructions back in the system prompt
Aug 14, 2026
ad26d2b
chore(fork): register the test fixture disposal as a patched file
Aug 14, 2026
692045e
fix(prompt): persist agent/model directly instead of via v2 events
Aug 14, 2026
cdf05df
fix(task): only refuse a subagent when the parent is KNOWN busy
Aug 14, 2026
c59523f
fix(prompt): don't retry a turn that finished before the loop started
Aug 14, 2026
580e7ad
fix(npm,provider): install the package, resolve the export subpath
Aug 14, 2026
09325e2
chore(fork): register npm.ts subpath handling as a patched file
Aug 14, 2026
d7ac9c4
chore(fork): register the 141 fork-only files as owned
Aug 14, 2026
b899bc9
fix(tools): restore the MCP resource tools the fork had dropped
Aug 14, 2026
bbdb8ff
fix(tui): restore the context percentage on the subagent footer
Aug 14, 2026
272874b
fix(provider): Bedrock honours a configured API key and region
Aug 14, 2026
3342c0f
test(provider): make the discovery-URL assertion order-independent
Aug 14, 2026
82d91b7
fork: run fork:verify on push so a lost feature fails the build
Aug 14, 2026
8ff9e09
chore(fork): register 64 more fork edits with verified markers
Aug 14, 2026
07c340b
chore(fork): finish classifying the divergence backlog
Aug 14, 2026
f84cdd1
fork: run fork:verify on push so a lost feature fails the build
Aug 14, 2026
dfda730
fix(cli): restore auto-mode in run.ts, reverted by a stray index entry
Aug 14, 2026
6cf1fbe
feat(fork-verify): check HEAD as well as the working tree
Aug 14, 2026
bf4593a
loop: two empty turns are not the model repeating itself
Aug 13, 2026
0d11ab9
Merge origin/dev into dev
Aug 14, 2026
a3da16f
fix(opencode): enable web search for Go (#42630)
Aug 14, 2026
8dce9c0
fix(upgrade): keep script output out of the user-facing error
Aug 14, 2026
03fe079
openspec(per-model-placement-controls): design decisions and fleet fi…
Aug 14, 2026
42392f0
Merge remote-tracking branch 'upstream/dev' into dev
Aug 14, 2026
1179ae0
fork: sync upstream a3da16f677, bump baseline to fork/2026-08-14.1
Aug 14, 2026
3c65829
docs(skill): add fork-sync, so a lost feature is not relearned each time
Aug 14, 2026
a26df04
opencode,core: fix broken LayerNode wiring across services
Aug 14, 2026
4aada1e
loop: fix false-positive stalls on long structurally-similar output
Aug 14, 2026
fac03db
docs(fix-loop-stall): mark task 6 done - verified against real models
Aug 14, 2026
646bb07
fix(tui): wrap the app in PermissionProvider
Aug 14, 2026
4dc9f64
fix(core): drop the unbuildable defaultLayer on session-execution-local
Aug 14, 2026
15088bf
fix(opencode,tui): clear pre-push typecheck gate across MCP v1->v2 mi…
Aug 14, 2026
79088a4
fork: accept divergence from the defaultLayer-export sweep + today's …
Aug 14, 2026
bec4ce3
fix(opencode): resolve post-rebase duplicate declarations and missing…
Aug 14, 2026
b339497
test(tool): update bash wire-shape snapshot for the description param…
Aug 14, 2026
14260c2
tui: block ctx selection on max_physical_ctx, not max_fit_ctx
Aug 14, 2026
33c2e5d
loop: don't burn the iteration budget on a foreign-turn skip
Aug 14, 2026
f0a07be
tui: restore the permission auto-approve command palette entry
Aug 15, 2026
5377f98
tui: rename /auto (backlog run) to /backlog
Aug 15, 2026
cf7b369
tui: run palette-started backlog in the visible session
Aug 16, 2026
308c121
provider: raise local-provider header timeout default to 600s
Aug 16, 2026
63d132e
tui: wire permission.mode into the global keybind dispatcher
Aug 16, 2026
d00957e
tool: default background subagents to background, not foreground
Aug 16, 2026
7bc3566
tui, cli: add permission "Remember" option and `opencode permission` …
Aug 17, 2026
b92bc5f
fix: stream-stall watchdog fallout and provider-first model search
Aug 18, 2026
ee538f8
fix(session): remove the stream-inactivity watchdog
Sep 4, 2026
36424e6
plan: linked openspec changes for loop/subagent/peer/Claude-protocol …
Sep 5, 2026
668697e
loop: make /loop relentless by default (loop-eternal-by-default)
Sep 5, 2026
aa38614
tool: add send_peer_message for same-directory agent-to-agent messagi…
Sep 5, 2026
6f70008
fork: reconcile manifest with ee538f8be3 and register new fork files
Sep 5, 2026
6260537
tool: fix peers and send_peer_message never being reachable by the model
Sep 5, 2026
6746b3c
plan: claude-peer-protocol-spike GO — real protocol verified, finding…
Sep 5, 2026
dfc3cc9
Merge branch 'skein/introduce-a-named-abstraction-for-c' into dev
Sep 9, 2026
a31b453
feat(provider): improve provider handling and dialog provider UI
Sep 9, 2026
53060bc
fix(build): give local builds a real version so OpenCode Zen free tie…
Sep 17, 2026
fd551cb
fix(context): make ContextManager.provide generic so it returns fn()'…
Sep 17, 2026
fdcbcab
feat(peers): discover Claude Code sessions alongside opencode peers, …
Sep 17, 2026
8a240be
feat(peers): message Claude Code sessions both ways over its local pe…
Sep 17, 2026
eb9c263
fix(tui): stop long-running sessions from growing until the machine dies
Sep 17, 2026
88c4ebc
fix(local): make /disconnect of a local provider stick
Sep 17, 2026
1e4747c
chore(fork): register new fork files, identifiable local build versio…
Sep 17, 2026
1540787
fix(tui): auto-approve badge and toggle follow config auto_mode too
Sep 17, 2026
1a45943
spec(skein-pool): one placement layer for local hosts and live agents…
Sep 17, 2026
ec0f223
chore(specsync): link skein-pool to #88
Sep 17, 2026
22c2386
feat(pool): delegate a subagent task to an idle peer agent when every…
Sep 17, 2026
217001b
spec(skein-pool): phases 1, 2, 4 done except live checks
Sep 17, 2026
c865700
fix(pool): roster hides unreachable cloud endpoints, idle host with n…
Sep 17, 2026
8ed4e8d
chore(fork): drop the unwired per-change worktree module; upstream's …
Sep 17, 2026
60dc42e
chore(fork): delete the 77 dead defaultLayer exports re-added in a26d…
Sep 17, 2026
bc7ea8b
fix(tui): sidebar hardware poll keys on host+model so a model switch …
Sep 17, 2026
e28bc5c
spec: record dispositions for 50 changes; add fleet-live-verification
Sep 17, 2026
fd6d421
fix(config): stop provider writes from burning {env:} references onto…
Sep 17, 2026
ae400f1
spec: archive 50 completed or superseded changes
Sep 17, 2026
ebb2989
chore(fork): register env-reference test from fd6d4213b9
Sep 17, 2026
5235dea
fix(session): make loop-dead sessions refuse auto-compaction
Sep 18, 2026
7304677
fix(session): detect repeated tool calls as a stuck loop, not just re…
Sep 18, 2026
4c0c877
fix(peers): surface sibling opencode sessions as peers, not just Clau…
Sep 18, 2026
eb3f299
fix(task): don't let a malformed task_id crash the tool
Sep 18, 2026
b21ebba
fix(tui): add /auto slash command and make the footer agent/auto badg…
Sep 18, 2026
a0bcaf2
fix(tui): give shift+tab a dedicated job, teach auto-approve in tips
Sep 18, 2026
f51c3f8
chore(fork): register today's fork-owned files and edits in the manifest
Sep 18, 2026
ddc51de
feat(app): extend V2 Model Settings with Installed/Discover/Operations
Aug 13, 2026
80bd3a0
docs(openspec): mark model-gallery-ui task 6.1 done
Aug 13, 2026
278e54f
docs(openspec): record real browser verification of task 6.1
Aug 14, 2026
8145ff9
feat(gallery): search, install plan/submit, operations list/cancel ov…
Sep 18, 2026
0000894
fix(peers): route messages to sibling opencode sessions through their…
Sep 18, 2026
df422d5
feat(tui): model gallery — /browse searches the catalog, per-host fit…
Sep 18, 2026
66618fb
fix(gallery): talk to llama-skein's control plane, not the /v1 base —…
Sep 18, 2026
baa4b79
feat(app): model gallery Discover (search, detail, per-host fit, conf…
Sep 18, 2026
ed4df94
feat(gallery): manage installed models — inventory per host with shar…
Sep 18, 2026
b9d5000
spec(model-gallery-ui): sections 6–8 shipped, section 11 model manage…
Sep 18, 2026
89af738
feat(app): manage installed models per host — load/unload, hide vs de…
Sep 18, 2026
93756c2
fix(peers): sibling sessions in other projects resolve through the si…
Sep 18, 2026
4a689bc
feat(gallery): prefer llama-skein store_id for shared-store detection…
Sep 18, 2026
50dbee5
spec(model-gallery-ui): 11.6 store identity done
Sep 18, 2026
8661978
feat(gallery): copy/move pulls files host-to-host via llama-skein sou…
Sep 18, 2026
9cc4955
chore: regenerate llama-skein client from merged contract
Sep 18, 2026
bc5f656
Remove leaked cache/log artifacts and personal notes; genericize paths
Sep 18, 2026
04ed816
Add a persistent peer registry; stop blocking /local on a fresh mDNS …
Sep 18, 2026
53f620d
Genericize leaked home-lab hostnames in archived openspec docs
Sep 18, 2026
28178b3
Explain what opencode-skein is at the top of the README
Sep 18, 2026
2040a63
Finish genericizing personal paths/hostnames missed by the first pass
Sep 18, 2026
0eb3864
Fix test broken by earlier genericization; keep this file's naming co…
Sep 18, 2026
fc82f25
docs(privacy): redact home-network broker address from archived proposal
Sep 18, 2026
32084e7
docs+test(privacy): replace real home-network details with generic ex…
Sep 18, 2026
413d704
docs(fork): releasing — how to cut a skein release; updater verified
Sep 18, 2026
25918b3
spec(model-gallery-ui): live host-to-host copy verified
Sep 18, 2026
f906a13
chore(fork): re-baseline accepted upstream divergence
Sep 18, 2026
87d1890
fix(test): use a genuinely private-range IP in isPrivateURL fixture
Sep 18, 2026
1e5fa71
fix: gallery/dialog selection safety + stable local-build session cha…
Sep 19, 2026
c2feec6
fix: peer-conversation reliability — reachable, answerable, loop-free…
Sep 19, 2026
5ea9494
fix(cli): stop auto-updating over a local or dev-channel build (#92)
Sep 19, 2026
8a707c3
fix(peer): resolve InstanceRef before any session-scoped call in side…
Sep 20, 2026
b3c2243
fix(placement): remove subagent model allowlist, prefer loaded then h…
Sep 20, 2026
d71dd57
ci(release): refuse a skein release version below the provider floor
Sep 21, 2026
c42dd8e
fix(lock): restore the sha512 for @ff-labs/fff-bin-linux-arm64-gnu — …
Sep 21, 2026
093fa23
fix(ui): restore 12 upstream SVG icons the privacy scrub corrupted — …
Sep 21, 2026
5693993
fix(peer): log dropped sidecar inbound, correct InstanceRef docs (#95)
Sep 21, 2026
aa9ed46
fix(loop): stop hanging forever on a permission ask nobody can answer
Sep 21, 2026
810de1e
fix(loop): nudge a stuck agent instead of erroring; /backlog retries …
Sep 25, 2026
00d4b8c
plan(autonomous-swarm): epic + five child changes for lead authority,…
Oct 1, 2026
ee2ee6e
chore(specsync): record tracker refs for the autonomous-swarm changes…
Oct 1, 2026
10b8f01
plan(autonomous-swarm): add project-server and swarm-coordinator; dro…
Oct 1, 2026
63bdd3a
chore(specsync): record refs for project-server and swarm-coordinator
Oct 1, 2026
0e62858
plan(standing-publish-authority): keep credential stripping independe…
Oct 1, 2026
2951e14
plan(loop-done-handoff): name the one-queue-per-directory invariant a…
Oct 1, 2026
0609d26
feat(peer): lead grant schema, file reader and sender verification
Oct 1, 2026
6212e6e
feat(peer): frame a verified lead as the user's instruction on the si…
Oct 1, 2026
4d978c6
feat(cli): opencode lead set|off|show|verify|instructions with a huma…
Oct 1, 2026
2b7da55
feat(cli): cross-platform confirmation for lead set (macOS, Windows, …
Oct 1, 2026
01f709f
feat(policy): fail-closed load for the standing publish policy
Oct 1, 2026
2b2a0fa
plan(standing-publish-authority): record Phase 1 results and the Queu…
Oct 1, 2026
cfc7bc7
fix(policy): named rejection reasons, repo-read default branch, gh case
Oct 1, 2026
31da5c2
fix(loop): align SDK noProgressLimit with server default
Oct 1, 2026
90be1c5
plan(standing-publish-authority): Phase 1 revisions and live-test fin…
Oct 1, 2026
9be48af
plan(lead-authority): record live registry check of the address format
Oct 1, 2026
29a71f9
feat(cli): lead set --session for opencode sessions
Oct 1, 2026
275b0ed
feat(policy): derive session rules and the standing-authorization prompt
Oct 1, 2026
75ca81b
plan(lead-authority): record the xargs residual; confirmation is the …
Oct 1, 2026
e09a692
feat(policy): inject the standing authorization into session prompts
Oct 1, 2026
6c30718
feat(policy): commit and push gate decisions
Oct 1, 2026
818acb2
fix(policy): bound the cached grant by age, not only by mtime
Oct 1, 2026
7b84dcb
chore(fork): register the publish policy files in the manifest
Oct 1, 2026
7c3da32
chore(fork): register the loop defaults guard in the manifest
Oct 1, 2026
aadaeb2
plan(standing-publish-authority): operator decisions on credentials a…
Oct 1, 2026
ec21680
refactor(loop): extract the one-queue-per-directory rule into one fun…
Oct 1, 2026
76d1ac6
chore(fork): register the lead command through ForkCommands and decla…
Oct 1, 2026
60fa833
feat(policy): granted sessions push in-shell, merge driver, honest fi…
Oct 1, 2026
ed0bcb5
chore(fork): point the manifest at the renamed policy files
Oct 1, 2026
88b5506
merge: loop-no-progress-default into release/no-stop-1
Oct 1, 2026
2d603c9
merge: fix/loop-unattended-permission-asks into release/no-stop-1
Oct 1, 2026
63f0cff
merge: fix/loop-nudge-and-backlog-retry into release/no-stop-1
Oct 1, 2026
258e41e
merge: queue-per-directory-guard into release/no-stop-1
Oct 1, 2026
6a67fb7
chore(fork): declare the unattended permission fix in the manifest
Oct 1, 2026
7716be3
merge: feat/lead-authority into release/no-stop-1 (unreviewed)
Oct 1, 2026
c416e9a
feat(loop): wire the publish policy into the real commit gate
Oct 1, 2026
cb7100e
plan(standing-publish-authority): D8 wording, evidence-gated rather t…
Oct 1, 2026
7764343
fix(policy): close the refspec hole in the granted push allow
Oct 1, 2026
b54abd2
fix(policy): deny the bare refspec that writes the default branch
Oct 1, 2026
fa524fc
chore(fork): declare the real-git policy fixture
Oct 1, 2026
e908847
feat(loop): a drained queue keeps watching for new work instead of fi…
Oct 1, 2026
daa525c
feat(peer): a blocked agent climbs a ladder before it goes to its user
Oct 1, 2026
bdb8965
feat(policy): a push executor that validates its own argv
Oct 1, 2026
2dcf4d0
feat(loop): a turn that stops to ask the user or wait on a peer gets …
Oct 1, 2026
0619d79
merge: feat/done-handoff into release/no-stop-1
Oct 1, 2026
1a75056
fix(policy): a real merge driver, tested against real git
Oct 1, 2026
2c58eb2
plan(autonomous-swarm): record decisions, the git wrapper incident an…
Oct 1, 2026
c3c78c1
feat(permission): unattended runs are scoped by default; full auto is…
Oct 1, 2026
fcc9e05
perf(loop): idle-watch wakes on a file change and re-resolves only then
Oct 1, 2026
b97f88e
chore(fork): the permission patch marker is now Unattended.decide
Oct 1, 2026
247338e
merge: feat/done-handoff into release/no-stop-1
Oct 1, 2026
bc62c51
merge: feat/unattended-permissions into release/no-stop-1
Oct 1, 2026
899a9ce
plan(autonomous-swarm): record the idle-session CPU and memory measur…
Oct 1, 2026
62395c0
plan(autonomous-swarm): correct the CPU note; most sessions are busy,…
Oct 1, 2026
65573ce
fix(permission): the unattended policy now governs queue loops, not o…
Oct 2, 2026
38b2e74
merge: feat/unattended-permissions fix into release/no-stop-1
Oct 2, 2026
b79ada2
merge: publish-policy-validation (#99) into release/no-stop-1
Oct 2, 2026
976186d
fix(test): close the fingerprint describe block the merge cut off
Oct 2, 2026
a4f76c4
merge: openspec/autonomous-swarm (plan, findings, tracker refs) into …
Oct 2, 2026
7192d14
fix(permission): fence prompt-mode loops, refuse secrets and doom_loo…
Oct 2, 2026
45edc19
merge: unattended permission fence fix into release/no-stop-1
Oct 2, 2026
03601f6
fix(permission): state what the secret refusal does not cover; narrow…
Oct 2, 2026
e70ea07
fix(loop): a finished loop no longer reports that it is watching
Oct 2, 2026
f717e2a
merge: feat/unattended-permissions review fixes into release/no-stop-1
Oct 2, 2026
ac9a037
merge: feat/done-handoff review fixes into release/no-stop-1
Oct 2, 2026
b7d95c8
Merge release/no-stop-1: agents that keep working (#105)
Oct 2, 2026
39e5a9e
plan(project-server): Phase 0 spike results and a design change they …
Oct 2, 2026
3166e2b
feat(policy): read a review record and map it onto merge evidence
Oct 2, 2026
197dc58
feat(policy): address review feedback on the review record
Oct 2, 2026
8982341
plan(project-server): correct the registration finding; state the cos…
Oct 2, 2026
abadec9
Merge review-record-schema: the review record reader (#107)
Oct 2, 2026
09fa290
Merge spike/project-server: Phase 0 spike results (#106)
Oct 2, 2026
85e07b7
plan(review-on-done): record authenticity is an explicit phase
Oct 2, 2026
3923fa7
feat(lead): a grant that lasts until the lead session ends, bound to …
Oct 2, 2026
0ae9c1d
fix(peer): parse cross-session envelopes by attribute name so hop-cha…
Oct 2, 2026
c1124f9
Merge pull request #109 from androidand/feat/lead-session-grant
Oct 3, 2026
eed1834
Merge pull request #108 from androidand/plan/review-authenticity
Oct 3, 2026
d7360d4
Merge pull request #110 from androidand/fix/envelope-extra-attributes
Oct 3, 2026
6932a31
feat(policy): the merge driver refuses a verdict the author wrote, an…
Oct 3, 2026
6adf23b
docs(review-on-done): peer sender identity is a claim, not an authent…
Oct 3, 2026
35004b5
docs(review-on-done): correct line references in the authenticity fin…
Oct 3, 2026
3bdfbf0
Merge pull request #111 from androidand/feat/review-authenticity-driver
Oct 3, 2026
e9fc04d
docs(review-on-done): tighten citation ranges to the quoted blocks
Oct 3, 2026
3fde1cd
docs(review-on-done): withdraw the server-attributed recommendation
Oct 3, 2026
c328683
docs(sidecar): orphaned sidecars cannot be reclaimed
Oct 3, 2026
7efff55
fix(sidecar): a sidecar cannot outlive a parent that died before it s…
Oct 3, 2026
fc2bbed
docs(sidecar): record the confirmed mechanism and the landed fix
Oct 3, 2026
f993f2c
feat(loop): cross-repo auto mode with work-source and drain-complete fix
Oct 3, 2026
14a200a
chore(fork): register work-source and auto-mode test files
Oct 3, 2026
3c02359
feat(loop): per-repo gate options for cross-repo auto runs (D5 fallback)
Oct 3, 2026
0107e34
test(loop): per-repo gate resolution test (D5 fallback)
Oct 3, 2026
ca72316
test(loop): D5 failure proof — correct repo completes, wrong-config r…
Oct 3, 2026
f6bb40f
fix(loop): correct terminal status type in D5 failure proof test
Oct 3, 2026
4a42d91
feat(crew): routing decision function with unit tests (Phase 2a.1)
Oct 3, 2026
c026659
test(loop): work-source client tests + null-output fix (Phase 3.1)
Oct 3, 2026
3ce588f
feat(loop): skip missing repos in auto mode + Phase 3.2 test
Oct 3, 2026
8a99d0b
feat(loop): capacity-bounded concurrency in auto mode (Phase 3.4)
Oct 3, 2026
5d0c5d3
feat(loop): add environmental guard for consecutive halts (Phase 3.5)
Oct 3, 2026
c509c05
feat(loop): add claim/release lifecycle for cancellation (Phase 3.6)
Oct 3, 2026
7b31baa
fix(loop): fence auto runs with QueueDenyRules (Phase 3.7)
Oct 3, 2026
70d6c7c
feat(loop): aggregated report covers all items (Phase 4.1)
Oct 3, 2026
d5cf928
feat(loop): distinguish drained from found nothing (Phase 4.2)
Oct 3, 2026
52516a5
feat(cli): add --auto flag to loop command (Phase 5.1, 5.2)
Oct 3, 2026
1ecc4db
test(loop): two-repository fixture drains to completion (Phase 6.1)
Oct 3, 2026
a97d9b7
test(loop): halt path end-to-end (Phase 6.2)
Oct 3, 2026
899266b
feat(loop): add autoDirectory and autoRepos fields
Oct 3, 2026
51343b5
Merge pull request #96 from androidand/ci-skein-release-version-floor
Oct 3, 2026
e86a6fd
test(sidecar): prove the EOF guard fires, not merely that the sidecar…
Oct 3, 2026
9165160
Merge pull request #112 from androidand/review-identity-finding
Oct 3, 2026
224bcc4
Merge pull request #113 from androidand/sidecar-orphan-cleanup
Oct 3, 2026
8b93575
Merge pull request #115 from androidand/loop-wip-reconcile
Oct 3, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
fix(sidecar): a sidecar cannot outlive a parent that died before it s…
…tarted

The ppid guard compares process.ppid against a value captured at startup, so it
can only see a parent that dies afterwards. If the parent is already gone by the
time the sidecar reads its own ppid, that value is the reparented one, the
comparison is false forever, and the sidecar survives indefinitely — which is
how 44 of them accumulated here and had to be killed by explicit PID. Mechanism
reproduced before fixing (Bun 1.3.14/macOS): SIGKILL the spawner before the
child's first ppid read and the child records ppid 1 and never notices.

The parent's stdin pipe closes when the parent dies, at any point in the sidecar's
life, so EOF cannot be missed by a startup race. Exit on it.

The discriminator is isSocket(), not isFIFO(). Measured: a child spawned with
stdio ["pipe"] reports isSocket()=true, isFIFO()=false (mode 140000), while
stdio "ignore" reports isCharacterDevice()=true (/dev/null). My first attempt
checked isFIFO(), which silently disabled this guard in production and matched
nothing — the failing test caught it, not review. The check exists because every
test spawns with stdio "ignore", where stdin is /dev/null and reads EOF
immediately; an unguarded listener would kill a healthy sidecar on startup.

Also bound the stop. shutdown() set shuttingDown before awaiting sidecar.stop(),
so a stop() that never settled left the process alive and every later SIGTERM
swallowed — killable only by SIGKILL. The exit now happens on a timer rather than
on stop() settling.

The new test retries rather than asserting once: hitting the race depends on bun's
startup time, so an attempt where the sidecar never registered proves nothing and
is discarded. It only passes having observed a registration appear and then
disappear, so it cannot pass vacuously. Verified by disabling the guard — the test
fails, and passes with it restored. test/peer 211 pass / 0 fail.

Not addressed here: reclaiming sidecars already leaked elsewhere, and the operator
command. Those are separate tasks in the change.
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@androidand
androidand committed Oct 3, 2026
commit 7efff559d0cae9617a2f65a40fef3efcd8bc6e38

There are no files selected for viewing

1 change: 1 addition & 0 deletions 1 fork/manifest.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"packages/opencode/test/peer/claude/probe-deliver-runtime.mts",
"packages/opencode/test/peer/claude/sidecar-diagnostic-routing.test.ts",
"packages/opencode/test/peer/claude/sidecar-server-name.test.ts",
"packages/opencode/test/peer/claude/sidecar-startup-race.test.ts",
"packages/opencode/src/local/model-gallery/search.ts",
"packages/opencode/src/local/model-gallery/install.ts",
"packages/opencode/src/local/model-gallery/operations.ts",
Expand Down
51 changes: 51 additions & 0 deletions 51 packages/opencode/src/peer/claude/sidecar-entry.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
// peer. Never touches the opencode server's HTTP API or any credential for
// it — the parent process does the actual session injection, this process's
// only job is being a real, Claude-compatible peer.
import { fstatSync } from "fs"
import { startSidecar } from "./sidecar-server"

/** Upper bound on how long a sidecar may stay alive after it decides to stop. */
const STOP_TIMEOUT_MS = 5_000

export async function runSidecarEntry() {
const ownerSessionID = process.env.OPENCODE_SIDECAR_OWNER_SESSION_ID
if (!ownerSessionID) {
Expand Down Expand Up @@ -66,11 +70,37 @@ export async function runSidecarEntry() {
})
process.stdin.on("error", () => undefined)

// Whether stdin is a real pipe from the parent, or /dev/null because the
// spawner passed stdio: "ignore". Decided once, before any listener can fire,
// so a misdetection cannot kill a live sidecar.
//
// Not `isFIFO()`. Measured on Bun 1.3.14/macOS: a child spawned with
// stdio: ["pipe"] reports isSocket()=true, isFIFO()=false (mode 140000), while
// stdio: "ignore" reports isCharacterDevice()=true (mode 20000, /dev/null).
// Bun gives the child a socketpair end, not a FIFO, so checking isFIFO()
// silently disables this guard in production and only ever matches nothing.
const stdinIsPipe = (() => {
try {
const s = fstatSync(process.stdin.fd ?? 0)
return s.isSocket() || s.isFIFO()
} catch {
return false
}
})()

let shuttingDown = false
const shutdown = () => {
if (shuttingDown) return
shuttingDown = true
clearInterval(orphanCheck)
// Bound the stop. `sidecar.stop()` closes the listening socket and removes
// the registration; if that never settles (a hung close), the original
// `.finally(process.exit)` never fires — and because `shuttingDown` is now
// true, every later SIGTERM is swallowed and the process is unkillable
// except by SIGKILL. So the exit is guaranteed on a timer rather than on
// stop() settling.
const bail = setTimeout(() => process.exit(0), STOP_TIMEOUT_MS)
bail.unref()
sidecar
.stop()
.catch(() => undefined)
Expand All @@ -96,6 +126,27 @@ export async function runSidecarEntry() {
}, 2_000)
orphanCheck.unref()

// The ppid guard above has a startup blind spot: it can only see a parent that
// dies AFTER this line runs. If the parent is already gone by the time we read
// `process.ppid`, the value captured here is the reparented one, the comparison
// is false forever, and the sidecar survives indefinitely. Reproduced on
// Bun 1.3.14/macOS: SIGKILL the parent before the child's first ppid read and
// the child records ppid 1 and never notices.
//
// The parent's stdin pipe closes when the parent dies, at ANY point in our
// lifetime, so EOF on a real pipe is a signal that cannot be missed by a
// startup race. Registered after `orphanCheck` exists so `shutdown`'s
// `clearInterval(orphanCheck)` cannot hit the temporal dead zone.
//
// Only when stdin is genuinely a pipe. `sidecar-manager.ts` spawns us with
// `stdin: "pipe"`, but tests spawn with `stdio: "ignore"`, which hands us
// /dev/null — that reads EOF immediately and would kill a perfectly healthy
// sidecar on startup. A FIFO is the discriminator.
if (stdinIsPipe) {
process.stdin.on("end", shutdown)
process.stdin.on("close", shutdown)
}

// Never resolve on its own: when run as `debug claude-sidecar-entry`,
// returning here would let `index.ts`'s `cli.parse()` complete, which
// unconditionally force-exits the whole process afterward — confirmed
Expand Down
138 changes: 138 additions & 0 deletions 138 packages/opencode/test/peer/claude/sidecar-startup-race.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
// The startup race: a sidecar whose parent dies BEFORE the sidecar reads its
// own ppid is already reparented, so the ppid-guard in sidecar-entry.ts can
// never fire and the sidecar survives forever.
//
// The existing orphan test in sidecar-e2e.test.ts:222 waits for the
// registration before killing the parent, so it always exercises the case the
// ppid guard handles. This file covers the case it cannot.
//
// The mechanism was reproduced directly before writing this (Bun 1.3.14,
// macOS): SIGKILL the spawner before the child's first ppid read and the child
// records ppid 1 and never observes a change.
import { describe, expect, test } from "bun:test"
import { mkdtemp, readdir, rm } from "fs/promises"
import { tmpdir } from "os"
import { join } from "path"
import { spawn } from "child_process"

const ENTRY = join(import.meta.dir, "../../../src/peer/claude/sidecar-entry.ts")

/**
* Spawns a sidecar whose parent exits immediately, without waiting for the
* sidecar to register — so the child is very likely already reparented by the
* time it evaluates process.ppid. `killAfterMs: 0` makes the race as tight as
* possible.
*/
async function spawnWithParentExitingAt(opts: { killAfterMs: number; stdin: "pipe" | "ignore" }) {
const claudeConfigDir = await mkdtemp(join(tmpdir(), "sidecar-race-claude-"))
await Bun.write(join(claudeConfigDir, "placeholder"), "")
const socketDir = await mkdtemp(join(tmpdir(), "sidecar-race-sock-"))
const fakeParent = join(await mkdtemp(join(tmpdir(), "sidecar-race-parent-")), "spawn-and-exit.ts")

await Bun.write(
fakeParent,
`
import { spawn } from "child_process"
const child = spawn("bun", ["run", ${JSON.stringify(ENTRY)}], {
env: { ...process.env },
stdio: [${JSON.stringify(opts.stdin)}, "pipe", "ignore"],
})
child.stdout.on("data", () => {})
// Expire without signalling: no SIGTERM to the sidecar, so nothing but the
// sidecar's own detection can end it.
setTimeout(() => process.exit(0), ${opts.killAfterMs})
`,
)

const proc = spawn("bun", ["run", fakeParent], {
env: {
...process.env,
CLAUDE_CONFIG_DIR: claudeConfigDir,
OPENCODE_SIDECAR_OWNER_SESSION_ID: "ses_race_test",
OPENCODE_SIDECAR_CWD: "/repo",
OPENCODE_SIDECAR_NAME: "opencode-race-test",
OPENCODE_SIDECAR_SOCKET_DIR: socketDir,
},
stdio: "ignore",
})
await new Promise<void>((resolve) => proc.once("exit", () => resolve()))
return { claudeConfigDir, socketDir }
}

describe("sidecar startup race", () => {
test("a sidecar whose parent exits before its first ppid read still terminates", async () => {
// Timing-dependent by nature: to hit the race the parent must die before the
// child reads its own ppid, and bun's own startup time decides whether that
// happened. So this retries, and — crucially — only concludes when it has
// actually OBSERVED the sidecar register and then clean up. An attempt where
// the sidecar never registered proves nothing and is retried, so this cannot
// pass by never exercising the race at all.
const ATTEMPTS = 4
let sawRegistration = false
let leaked = false

for (let attempt = 0; attempt < ATTEMPTS && !leaked; attempt++) {
const { claudeConfigDir } = await spawnWithParentExitingAt({ killAfterMs: 0, stdin: "pipe" })
const sessionsDir = join(claudeConfigDir, "sessions")
const appeared = Date.now() + 8_000
let registered = false
while (Date.now() < appeared && !registered) {
const entries = await readdir(sessionsDir).catch(() => [])
registered = entries.some((e) => e.endsWith(".json"))
if (!registered) await new Promise((r) => setTimeout(r, 100))
}
if (!registered) {
await rm(claudeConfigDir, { recursive: true, force: true })
continue // inconclusive: the race window was not reached this time
}
sawRegistration = true

const gone = Date.now() + 12_000
let stillThere = true
while (Date.now() < gone && stillThere) {
const entries = await readdir(sessionsDir).catch(() => [])
stillThere = entries.some((e) => e.endsWith(".json"))
if (stillThere) await new Promise((r) => setTimeout(r, 150))
}
leaked = stillThere
await rm(claudeConfigDir, { recursive: true, force: true })
}

// Guard the guard: if no attempt ever registered, the test proved nothing.
expect(sawRegistration).toBe(true)
expect(leaked).toBe(false)
}, 120_000)

test("stdin: ignore does not kill a sidecar on startup", async () => {
// Regression guard for the fix itself. With stdio "ignore" the child's stdin
// is /dev/null, which reads EOF immediately; a naive EOF-means-dead-parent
// listener would exit a perfectly healthy sidecar the moment it started.
const claudeConfigDir = await mkdtemp(join(tmpdir(), "sidecar-noeof-claude-"))
const socketDir = await mkdtemp(join(tmpdir(), "sidecar-noeof-sock-"))

const child = spawn("bun", ["run", ENTRY], {
env: {
...process.env,
CLAUDE_CONFIG_DIR: claudeConfigDir,
OPENCODE_SIDECAR_OWNER_SESSION_ID: "ses_noeof_test",
OPENCODE_SIDECAR_CWD: "/repo",
OPENCODE_SIDECAR_NAME: "opencode-noeof-test",
OPENCODE_SIDECAR_SOCKET_DIR: socketDir,
},
stdio: ["ignore", "pipe", "ignore"],
})
let out = ""
child.stdout?.on("data", (c: Buffer) => (out += c.toString("utf8")))

const deadline = Date.now() + 10_000
while (Date.now() < deadline && !out.includes('"type":"ready"')) {
await new Promise((r) => setTimeout(r, 100))
}
// It must still be running and registered after /dev/null EOF has passed.
expect(out).toContain('"type":"ready"')
expect(child.exitCode).toBeNull()
child.kill("SIGKILL")
await rm(claudeConfigDir, { recursive: true, force: true })
await rm(socketDir, { recursive: true, force: true })
}, 20_000)
})
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.