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 — fix(server): provider updates restart that provider's idle sessions by incognitojam · Pull Request #1574 · incognitojam/styal

Conversation

@incognitojam

@incognitojam incognitojam commented Nov 18, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Owner

Note

After a verified provider update, styal releases the idle sessions still running the replaced install, before any waiting turn starts. A session in use (a running turn or compaction, a turn start or rollback that has opened it, background work, a recent question) is kept and retires shortly after that use ends, never later than it would have without the update.

After a provider update, sessions styal already started keep running the old process. Some installers keep one folder per version and delete the old one (vite-plus does), so a long-lived process can no longer start its helpers. Codex's shared app-server then failed every turn with failed to spawn code-mode host …: host executable was not found. It never restarted: it retires only after 30 idle minutes, and each failed turn counted as activity.

Now, once an update succeeds and its version is verified, and while new turns on that CLI are still held back, styal releases the sessions of every provider instance on the same install. The next turn starts a fresh process on the new version. This applies to manual and background updates, for the sessions styal itself runs.

When the update finishes What happens
Session idle Released before any waiting turn starts. A turn queued behind the update opens a fresh process on the new version, and the user sees nothing.
Turn or /compact running (possible with a manual update) It finishes on the old process. The session is released about a second after its last turn ends.
A turn has opened the session but not reached the provider yet (checkpoint, context handoff) Kept until the provider accepts or refuses the start, then as above.
A checkpoint rollback is using the session Kept until the rollback is done, then released a second later.
The session was still opening when the update finished (manual update) It starts out retiring: kept for whoever opened it, then released as above.
Background work still running (a command, a Codex subagent) Kept until it ends, checked each minute; work silent for four hours stops counting, as for the idle release. Codex shares one process per instance, so one chat's work keeps every chat on that instance on the old process.
A question pending less than an hour Kept until the question is an hour old (the background updater's cutoff) or the session's normal idle timeout passes, whichever comes first.
Another instance on the same install (same installer lock and package) Same as above.
Instance on a different install, such as OpenCode under the same npm lock Untouched.
Update failed, rejected, or already up to date Nothing released.
Installer exited 0 but the new version could not be verified ("unchanged") Nothing released, deliberately: releasing sessions when the new install may not work could leave no working process at all.

Review notes:

  • The runner now depends on the session manager, so its layer moved above orchestration in server.ts.
  • A turn start holds its session from just before it opens it until the provider accepts or refuses the start; a checkpoint rollback, the only other caller of open, holds it until the rollback is done. The turn's hold is taken after its wait on the install gate, so a turn queued behind an update holds nothing and gets a fresh process. The release reads the hold in the same atomic update that removes the session.
  • Compaction now goes through the same busy-turn tracking as a turn; every adapter's compaction ends with a turn end.
  • Known gaps:
    • A turn that opens the session within about a second of the previous turn ending, such as a queued message, keeps it and runs on the old process. With an installer that deleted the old folder, that one turn can fail; the session retires after it.
    • A turn start that never settles keeps its hold, and with it a retiring session, until it does.
  • OpenCode's own background server is not restarted here and can keep serving the old binary. The upstream after-update hook below covers it once imported.

Relation to upstream pingdotgg#34606 (merged upstream, not yet in the fork): it adds a driver afterUpdate hook that refreshAfterUpdate calls before the version is read back, implemented only for OpenCode to replace OpenCode's own background server. This change acts one step later, in the runner after verification, on styal's own sessions. The two touch different code. Once both are in, an OpenCode update replaces the background server first and then releases styal's sessions on that install.

Verification

  • Session manager, run once with a turn and once with /compact: an idle session is released at once. A busy one stays live, survives a follow-up turn that opens it within the second and takes over a second to start, then is released one second after that turn ends, with the idle timeout set to an hour. A session opened by a start that is then refused stays live while held and is released a second after the hold ends. Removing the hold check fails both runs; removing the compaction tracking fails the /compact run.
  • Session manager, kept sessions: one with background work is kept, then released within a minute of the work ending with no provider event. One with a pending question is kept until the question is an hour old under a two-hour idle timeout, and released at 30 minutes under a 30-minute one. Each fails if its rule is removed, if the background recheck waits the full idle timeout, or if the question can outlast the idle timeout.
  • Session manager: a session whose open is still in flight when its instance retires is released a second after it opens, instead of after the idle timeout; it fails without that.
  • Turn start: the session is held before it is opened and released only after the provider turn has run. Ending the hold before the provider turn fails five cases.
  • Rollback: the session is held before it is opened and released after the rollback writes its result, and also when opening fails.
  • Runner: a successful update retires the updated instance and a second instance on the same install while the install gate is held, and leaves the OpenCode instance alone. Failed, rejected and unchanged updates retire nothing.
  • Sandbox dev server built from this branch: it boots with the moved layer and no layer or service errors, and a turn on the Replay (dev) provider opens a session, streams and completes.

Not verified: no live provider update was run, and no real Codex app-server was exercised, so the original failure was not reproduced end to end. The Replay provider has no one-click update and every other provider would run its real installer, so the release path was not driven in the sandbox.


Written by claude/claude-opus-5-5 in styal 🧵.

Sorry, something went wrong.

Uh oh!

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

All reactions
@github-actions github-actions Bot added the size:L label Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Upstream divergence

Both sides are compared with upstream at the in-order tip 1d152c3df4. Excludes .repos/ and pnpm-lock.yaml.

Measure Base This PR Change
Upstream files the fork changes 2,267 2,268 +1
Lines changed in them 147,574 148,310 +736
Upstream files the fork removes 70 70 0
Fork-only files 952 952 0
Fork-only lines 171,941 171,935 −6

Upstream files that start to differ (1)

  • apps/server/src/orchestration-v2/CheckpointRestoreSafety.test.ts: +1 −0 from upstream
Upstream files whose difference changes (12)
File Change Now differs by
apps/server/src/orchestration-v2/ProviderSessionManager.ts +273 437 lines
apps/server/src/orchestration-v2/ProviderSessionManager.test.ts +260 476 lines
apps/server/src/provider/providerMaintenanceRunner.test.ts +80 1,058 lines
apps/server/src/provider/providerMaintenanceRunner.ts +41 297 lines
apps/server/src/orchestration-v2/ProviderTurnStartService.test.ts +24 438 lines
docs/user/updating.md +15 243 lines
apps/server/src/orchestration-v2/ProviderTurnStartService.ts +14 294 lines
apps/server/src/orchestration-v2/CheckpointRollbackService.test.ts +13 29 lines
apps/server/src/orchestration-v2/CheckpointRollbackService.ts +10 15 lines
apps/server/src/orchestration-v2/EffectWorker.test.ts +2 4 lines
apps/server/src/orchestration-v2/ProviderTurnControlService.test.ts +2 6 lines
apps/server/src/server.ts +1 271 lines
All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions

github-actions Bot commented Nov 18, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Baseline: 59c7e70 · PR result: 5aa28a0 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions

github-actions Bot commented Nov 18, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Agent context growth

Agent context is no longer larger than main, so this PR does not need the agent-context-increase label.

Agent context is the instructions and MCP tool list styal sends into every user's agent session. Sizes are UTF-8 bytes.

Context main This PR Change
Claude system append 5,835 5,835 0
Codex additional context 7,555 7,555 0
MCP tool list 55,088 55,088 0

Compared main at 59c7e70 with this PR at 5aa28a0.

All reactions

Sorry, something went wrong.

Uh oh!

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

incognitojam added 3 commits November 18, 2026 03:50
@incognitojam
fix(server): provider updates restart that provider's idle sessions
fd02c6e
A successful, verified provider update now releases the live sessions of
every instance on the same install while the install gate still holds new
turns back. A session with a busy turn or background work stays, and
retires shortly after it goes idle instead of after the 30-minute idle
timeout. Failed, rejected and unverified updates release nothing.

Installers that keep one folder per version delete the old one, and a
long-lived process such as Codex's shared app-server then fails every turn
that spawns a helper from it.
@incognitojam
fix(server): retiring sessions keep starting turns, compactions and r…
6b37156
…ecent questions

A turn now holds its provider session from before it opens it until the
provider accepts or refuses the start, and a retiring session is kept
while held. Compaction marks the session busy until its turn ends, like a
turn. A retiring session is also kept for a question pending less than an
hour, and one kept for background work or a question is checked each
minute rather than after the full idle timeout.
@incognitojam
fix(server): rollbacks hold their session and questions keep a retiri…
e6114c6
…ng one no longer than idle

A checkpoint rollback now holds its provider session from before it opens
it until it is done, like a turn start. A question keeps a retiring
session only until its normal idle timeout. A session whose open is still
in flight when its instance retires starts out retiring. The turn-start
test now checks that the hold outlasts the provider turn.
@incognitojam
incognitojam force-pushed the styal/provider-update-session-retirement branch from a202aec to e6114c6 Compare November 18, 2026 03:52
@incognitojam
test(server): restore-safety rollback mock implements the session hold
5aa28a0
@incognitojam
incognitojam marked this pull request as ready for review November 18, 2026 11:27
@incognitojam
incognitojam merged commit 1b4020d into main Nov 18, 2026
53 checks passed

Uh oh!

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

@incognitojam
incognitojam deleted the styal/provider-update-session-retirement branch November 18, 2026 11:27
incognitojam pushed a commit that referenced this pull request Nov 18, 2026
@eyeveil @incognitojam
fix(server): an interrupted provider update ends failed instead of ru…
06e3182
…nning forever (pingdotgg#33975)

Fork adaptation: Keep fork #915 update outcome recording and #1574 post-verification session retirement while applying upstream's settled flag and uninterruptible final-state write. The fork's canary-gated background install and cross-process lock remain unchanged.

(cherry picked from commit fe5b51e)
Upstream-PR: 33975
Fork-Feature: provider-auto-updates, codex-exit-reason
incognitojam pushed a commit that referenced this pull request Nov 18, 2026
@juliusmarminge @incognitojam
fix(server): provider launches and text generation wait for provider …
4d3d7e6
…updates (pingdotgg#31186)

Fork adaptation: The new service keys in `apps/server/src/provider/ProviderInstallationGate.ts` use the fork's package name. Keep fork #1574 retirement and holds: the new installation gate covers the install through verification and retiring replaced sessions, before queued launches resume. The existing ProviderInstallGate still gates turn starts and cross-process locks; upstream's reader/writer gate also protects session opens, Claude per-turn spawns and text generation. Gate each fallback attempt in the fork's provider-status/rate-limit selection (#732/#823/#845/#997, project filtering 500af6b), preserving its chosen instance. Retain #915 command telemetry and child PID recording. Remove a duplicate registry import from the combined tests and include the fork mentioned-time service stub.

(cherry picked from commit 9ce9b1f)
Upstream-PR: 31186
Fork-Feature: fork-distribution-identity, provider-auto-updates, text-generation-provider-preference, mentioned-time-chips
incognitojam pushed a commit that referenced this pull request Nov 18, 2026
@eyeveil @incognitojam
fix(server): an interrupted provider update ends failed instead of ru…
a37405c
…nning forever (pingdotgg#33975)

Fork adaptation: Keep fork #915 update outcome recording and #1574 post-verification session retirement while applying upstream's settled flag and uninterruptible final-state write. A verified install retires the replaced sessions inside that same uninterruptible write, so an interrupt after the installer succeeded cannot skip it; failed, unchanged and "Already up to date" outcomes retire nothing. The fork's canary-gated background install and cross-process lock remain unchanged.

(cherry picked from commit fe5b51e)
Upstream-PR: 33975
Fork-Feature: provider-auto-updates, codex-exit-reason
incognitojam pushed a commit that referenced this pull request Nov 18, 2026
@juliusmarminge @incognitojam
fix(server): provider launches and text generation wait for provider …
e695dbb
…updates (pingdotgg#31186)

Fork adaptation: The new service keys in `apps/server/src/provider/ProviderInstallationGate.ts` use the fork's package name. Keep fork #1574 retirement and holds: the new installation gate covers the install through verification and retiring replaced sessions, before queued launches resume. The existing ProviderInstallGate still gates turn starts and cross-process locks; upstream's reader/writer gate also protects session opens, Claude per-turn spawns and text generation. Gate each fallback attempt in the fork's provider-status/rate-limit selection (#732/#823/#845/#997, project filtering 500af6b), preserving its chosen instance. Retain #915 command telemetry and child PID recording. Remove a duplicate registry import from the combined tests and include the fork mentioned-time service stub.

(cherry picked from commit 9ce9b1f)
Upstream-PR: 31186
Fork-Feature: fork-distribution-identity, provider-auto-updates, text-generation-provider-preference, mentioned-time-chips
incognitojam pushed a commit that referenced this pull request Nov 23, 2026
@juliusmarminge @incognitojam
fix(server): Edit from here recreates a worktree folder that lost its…
395f004
… checkout (pingdotgg#35194)

Fork adaptation: The change to CheckpointRollbackService.ts is not taken. Upstream's change makes a file rollback delete a managed worktree folder that still exists but has no .git, and create the checkout again in its place. That deletes the untracked files in the folder, also when the provider session or the checkpoint restore fails after the checkout was created, and a provider process whose working directory is that folder is left in a deleted directory. The fork does not move or delete such a folder, as before; a file restore into it behaves as it did before, which fails for a folder outside any checkout but, for a folder inside another checkout, can reach that enclosing repository; a missing managed worktree folder is still created again, as it already was. Without that case, upstream's reordering of the shared-workspace check changes nothing, so the file keeps the fork's code, which first restores a freed source checkout under its workspace lease. The test takes upstream's rows that still hold: a conversation-only rollback leaves the folder and its untracked file in place, and a shared-workspace rollback rejects before any session is held, so it expects only the cleanup call. Upstream's row where a file rollback replaces the folder instead expects the rollback to reach the file restore and fail there, leaving the folder and its untracked file as they were, for a folder outside any Git checkout. The fork's sparse-checkout rows keep their real worktree (which has a .git file) instead of upstream's .git directory, and the fork's session hold/release calls (from fork #1574) stay in the expected call lists.

(cherry picked from commit 1032135)
Upstream-PR: 35194
Fork-Feature: worktree-source-checkout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

size:L

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

1 participant

@incognitojam
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.