Skip to content

fix(macos): keep saved Gateway runtime pins without automatic replacement - #160127

Merged
steipete merged 9 commits into
mainfrom
steipete/app-bun-service-runtime
Sep 28, 2026
Merged

steipete merged 9 commits into
mainfrom
steipete/app-bun-service-runtime

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Related: #159431

What Problem This Solves

Enabling or refreshing the macOS Gateway passed --runtime node, replacing an operator's saved runtime pin.

User Impact

Enabling preserves a saved pin and leaves runtime selection with the CLI. If the pin cannot be read or validated, or its bound service definition has changed, enable fails with the CLI error. Pin replacement requires an explicit operator reinstall with --runtime or --runtime-path; the app never retries with a runtime override. Disabling still uninstalls the LaunchAgent and removes its pin.

Why This Change Was Made

The maintainer decision is to preserve the existing explicit pin-replacement contract. The app now makes one install request without runtime-selection flags for every resolved CLI prefix, including Bun. The automatic retry, retry-only result tag, and dedicated tagging error were removed. Invalid-pin errors include the explicit reinstall instruction in the error message that the app displays. No pin schema or persistence contract changes.

Resolved ClawSweeper P1s from the prior head:

  • Leave transient runtime validation failures untagged: removed both runtime-pin-invalid emission sites and the app retry, so filesystem or executable-probe failures cannot trigger automatic pin replacement.
  • Require a choice before replacing a mismatched pin: restored the ordinary definition-mismatch error; replacement remains an explicit CLI operator action.

Bun-only fallback without a pin or recorded runtime remains separate work in #160189. Release-note context: macOS Gateway enable preserves saved runtime pins and returns actionable errors when explicit repair is needed; CHANGELOG.md is release-owned.

Evidence

  • Before the production correction, the revised installer test failed in the definition-mismatch and invalid-runtime cases: the old code still emitted the retry tag and omitted the repair instruction; the other five cases passed.
  • /usr/bin/time -p node scripts/run-vitest.mjs src/cli/daemon-cli/install.output.integration.test.ts src/daemon/runtime-pin-state.test.ts --maxWorkers=1: 10/10 passed across two files (one file in each routed shard), 209.88 seconds total wall including worker preparation/verification. CLI shard: 7/7, 51.49 seconds; SQLite pin-state shard: 3/3, 122.52 seconds. The persisted-state tests cover reopen, stale plans, definition mismatch, and explicit replacement.
  • pnpm tsgo:core passed.
  • The existing nonfatal fixture diagnostic remains: Config health-state write failed: Shared-state admission requires the host broker; all output and no-install assertions pass.
  • Correction versus 13ee9d8b09d739cbf92f384222280ff77c205b10: production +8/-29 (net -21 lines); obsolete retry coverage removed.
  • cd apps/macos && swift test --disable-sandbox --filter GatewayLaunchAgentManagerTests: 19 tests in one suite passed (0.186 seconds execution; 327.73 seconds build-and-test wall). The retained routing test covers managed CLI, Node, absolute Bun, and PATH Bun prefixes and checks enable sends no runtime override. No Keychain prompt occurred. This is intercepted app-boundary proof, not an installed-app enable/refresh run.
  • Installed macOS app enable/refresh with a saved pin was not run; no live Gateway or operator pin state was changed.
  • Scoped oxfmt, oxlint using config/tsconfig/oxlint.core.json, Swift source format/lint, and git diff --check passed. An initial oxlint invocation using the build tsconfig timed out in unnecessary extension-artifact preparation; the supported core lint lane passed.
  • Independent Codex autoreview of this correction at high reasoning, P0–P2: scoped-clean, no accepted/actionable findings. The only subsequent source edit restored a blank line between test declarations.
  • Final correction diffstat: 7 files changed, 13 insertions, 87 deletions; production net -21 lines.
  • ClawSweeper reviewed the pre-sync head fc10ab5e19f8f8a59fadb42d973441dad2b95039 at 2026-09-28 09:42 UTC: both prior P1s resolved, no actionable findings, and no before-merge blockers; installed-app proof is explicitly optional.
  • CI run 36404370042 ended with one root failure in checks-node-changed-compact-small-15 (job 108870424123) and a failed aggregate gate: 133 jobs succeeded, 15 were cancelled, and 18 skipped. Ten ACP lifecycle tests failed because the session-meta mock lacks prepareAcpSessionControlRead, added to the manager by main commit 1ac31be00c2 (fix(acp): settle Stop without overwriting replacement sessions #160035). CI tested the PR merged into main 4dbabc40f6fd; this PR does not change the ACP owner or fixture. Current main reproduced the same 10 failures; fixture-only fix ea6bf83e821f4808e081f8ff1ffa30b34414edd7 now supplies the two missing typed mock exports. Four focused files passed 136/136 tests in 117.63 seconds, with messaging test types, scoped lint/format, and independent autoreview passing. No CI job was rerun.
  • Synced the verified main repair into head 7e1e601bc2aeb47ee18ae73fe35e8e28152c2cdf. All runtime-pin source, test, and documentation bytes are unchanged by the merge, so their focused proof remains valid. Fresh independent review of the complete six-file PR candidate against merged main 764c3e39e2f004623f9351a5210e46503ccb6405 is scoped-clean through P2. ClawSweeper comment 5863854195, Revision 11, reviewed this exact head at 2026-09-28 10:24 UTC: Ready for maintainer review, no findings, Before merge: None. Current-head CI remains required before merge.
  • CI run 36408205995, attempt 1, was cancelled after checks-node-changed-compact-large-21-1 (job 108882690710) failed only src/security/install-policy.test.ts / "kills forked policy command children on no-output timeout" at 10052 ms: the overall 10000 ms deadline fired instead of the no-output deadline. The original job log confirms the failure. The fixture writes output after publishing its PID; that output can refresh the reused idle timer and cancel the manually fired deadline. The owning fix is fix(update): updates and repair fail on Bun-only installs without Node #159431, commit c1b47addc718d78fa75634801de7cf8e040ee74c, not yet on main. This PR does not change the failing fixture or policy code. Peter authorized one failed-jobs rerun for that known cause; GitHub accepted it as attempt 2 on the unchanged head. Attempt 2 completed SUCCESS on the unchanged head at 2026-09-28 11:03 UTC. The required openclaw/ci-gate became SUCCESS at 11:05:26 UTC. ClawSweeper Revision 12 reviewed this exact head at 10:49 UTC with no findings and no before-merge blockers. The latest completed main CI run 36410497689 succeeded, but the fixture remains unchanged on main. Native review guard and artifact validation passed for this exact head.

The macOS app enabled its LaunchAgent with an explicit `--runtime node`.
Since runtime pins exist, that flag clears pin intent, so every launch-agent
toggle wiped a runtime pinned with `openclaw gateway install --runtime-path`.
Drop it: the service configuration owns runtime selection, fresh installs
still default to Node, and forced reinstall keeps a pinned or recorded runtime.

When the app's resolved CLI runs under an absolute Bun executable, both the
macOS and Linux apps now pass `--runtime bun --runtime-path <bun>`, so a
Bun-only app install pins its own Bun.
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 28, 2026 05:00
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: macos App: macos app: linux size: S labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 6:49 AM ET / 10:49 UTC (Revision 12).

ClawSweeper review

What this changes

The macOS app stops overriding Gateway runtime selection with Node, while the CLI adds explicit repair guidance for invalid saved pins and the tests and docs describe the behavior.

Merge readiness

✅ Ready for maintainer review

Keep this PR open. Current main still forces Node when the macOS app enables its Gateway, and the branch addresses that saved-pin failure. The earlier P1 findings are resolved; this review found no new actionable defect.

Priority: P1
Reviewed head: 7e1e601bc2aeb47ee18ae73fe35e8e28152c2cdf

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary change with relevant regression coverage and no remaining correctness finding is ready for normal landing gates.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The PR reports passing macOS app-boundary and CLI install-handler tests, and explicitly states that installed-app pin refresh was not run. The Repository State identifies the author as MEMBER, so the external-contributor real-setup gate does not apply; the stored pin format is unchanged.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The PR reports passing macOS app-boundary and CLI install-handler tests, and explicitly states that installed-app pin refresh was not run. The Repository State identifies the author as MEMBER, so the external-contributor real-setup gate does not apply; the stored pin format is unchanged.
Evidence reviewed 10 items Current main retains the defect: The macOS enable request still includes an explicit Node runtime selection.
Introduced app correction: The pinned base-to-head diff removes the Node override from the app's install request.
CLI pin ownership: With no explicit runtime flag, the installer reads the existing pin and carries its path into the service install plan.
Findings None None.
Security None None.

How this fits together

The macOS app asks the Gateway CLI to install or refresh its LaunchAgent. The CLI reads saved runtime intent, validates it, and writes the service definition that starts the Gateway.

flowchart LR
A[macOS app enable] --> B[Gateway install CLI]
C[Saved runtime pin] --> B
B --> D{Pin valid?}
D -->|Yes| E[LaunchAgent definition]
D -->|No| F[Repair instruction]
E --> G[Gateway runtime]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +2, Tests +54, Docs +4, Other +12. Total +72 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 1 +2
Tests 1 54 0 +54
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 3 28 16 +12
Total 6 89 17 +72

Review metrics

None.

Technical review

Best possible solution:

Keep runtime selection with the CLI, preserve valid saved pins during app enable, and display the explicit reinstall instruction when a pin cannot be used.

Do we have a high-confidence way to reproduce the issue?

Yes, from current-main source: the macOS enable request passes --runtime node, which the CLI treats as an explicit runtime choice. This read-only review did not run the app.

Is this the best way to solve the issue?

Yes. Removing the app's override lets the existing CLI pin owner select and validate the runtime without adding a second pin policy in Swift.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fc168b2f6c16.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The current macOS enable path can replace an operator's saved Gateway runtime choice and disrupt a working service.
  • merge-risk: 🚨 compatibility: An invalid saved pin now stops app enable until explicit CLI reinstall; the member-authored PR records this intended operator contract.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR reports passing macOS app-boundary and CLI install-handler tests, and explicitly states that installed-app pin refresh was not run. The Repository State identifies the author as MEMBER, so the external-contributor real-setup gate does not apply; the stored pin format is unchanged.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-28T08:27:04.217Z sha a0984a1 :: blocked before merge. :: [P1] Do not treat every pin-state read error as an invalid pin
  • reviewed 2026-09-28T08:59:55.378Z sha 6be53d0 :: blocked before merge. :: [P1] Keep transient runtime validation failures non-retryable | [P1] Require an explicit choice before clearing a mismatched pin
  • reviewed 2026-09-28T09:13:51.046Z sha 13ee9d8 :: blocked before merge. :: [P1] Leave transient runtime validation failures untagged | [P1] Require a choice before replacing a mismatched pin
  • reviewed 2026-09-28T09:42:15.016Z sha fc10ab5 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-28T09:50:26.008Z sha fc10ab5 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-28T09:59:37.351Z sha fc10ab5 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-28T10:17:22.694Z sha 7e1e601 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-28T10:24:39.451Z sha 7e1e601 :: needs maintainer review before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

CI note: run 36380081999 failed one unrelated Bun-lane test, src/plugins/runtime.retention.test.ts ("Completed retirement retained a successor registry"). The retention fixture forces collections inside Promise continuations, and JavaScriptCore's microtask stack can still hold the completed async values. The fixture fix is in #160200. The failed jobs were rerun after the mechanism was established.

Leave runtime selection with the service installer. Remove both apps' Bun
runtime-path overrides, which could replace an operator pin, while retaining
the macOS fix that omits the pin-clearing explicit runtime node selection.

Enabling preserves an installed service's pin. Disabling still uninstalls the
LaunchAgent and removes the pin. CLI fallback on Bun-only hosts is separate.

Validation: 59 focused native tests passed in an isolated test-helper run;
SwiftFormat, docs formatting, and diff checks passed. Independent review of
the complete candidate is scoped-clean for P0-P2.
@steipete steipete changed the title fix(apps): toggling the Gateway clears a pinned runtime fix(apps): keep runtime pins when the macOS app enables its Gateway Sep 28, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Addressing the two P1 findings on c16380ec, both resolved at ff34d87f:

  • An existing pin must win over the app's Bun. Agreed. The app can't see the stored pin, and an explicit --runtime-path overrides it, so the app-side Bun flags are removed on both macOS and Linux. For a Bun-only host with no pin and no recorded runtime, gateway install itself now falls back to the running Bun; that's in fix(daemon): forced reinstall moves an unpinned Bun Gateway service to Node #160189. The app passes no runtime flags, so pins and recorded runtimes always win.
  • Preserve the pin across a full off/on toggle. Not changed, by design. Disabling the Gateway in the app runs gateway uninstall, and the service owner intentionally removes the pin along with the LaunchAgent; re-enabling is a fresh install. This PR fixes the enable/refresh path while the service stays installed, where the old --runtime node cleared the pin. The PR body and docs/platforms/mac/bundled-gateway.md now say so explicitly. Keeping pins across an uninstall would change pin retention and belongs in a separate decision.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
…its Gateway

Classify both CLI pin inspection and validation failures as runtime-pin-invalid
in JSON while preserving the existing human errors and exit code 1.

The macOS app keeps valid runtime pins, but retries an install once with
--runtime node when the CLI reports that typed failure. Log successful repair,
return retry failures, and leave unrelated failures unchanged.

Validation: CLI output and response tests passed 19/19 in 23.11s wall; the
install-output file passed 6 cases. Core typechecking, 60 focused native tests,
SwiftFormat, oxfmt, and whitespace checks passed. Independent P0-P2 review of
the complete candidate is scoped-clean. Both regressions failed before the fix.
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S and removed size: XS labels Sep 28, 2026
@steipete steipete changed the title fix(apps): keep runtime pins when the macOS app enables its Gateway fix(apps): recover an invalid runtime pin when the macOS app enables its Gateway Sep 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 28, 2026
@clawsweeper clawsweeper Bot removed the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label Sep 28, 2026
Give a saved pin's changed service definition a dedicated error class. Only
that inspection failure emits runtime-pin-invalid; transient IO/SQLite and
other inspection failures remain untagged so the app preserves the pin and
returns the error without resetting runtime selection.

Keep the invalid executable classification and all human errors unchanged.
Exercise the real pin reader with an IO-like state read failure and a changed
saved definition. The transient-read regression fails before this fix.

Validation: 10 focused tests passed in 97.32s wall (7 install-output cases and
3 pin-state cases), pnpm tsgo:core, oxfmt, and whitespace checks passed. Swift
is unchanged; existing coverage rejects retries for untagged failures.
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Sep 28, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Sep 28, 2026
…ment

Automatic runtime retries could discard an operator pin after transient validation failures or a changed service definition. Preserve the existing explicit replacement contract by returning the CLI error and naming the reinstall action instead.
@steipete steipete changed the title fix(apps): recover an invalid runtime pin when the macOS app enables its Gateway fix(macos): keep saved Gateway runtime pins without automatic replacement Sep 28, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The current head removes automatic runtime-pin replacement entirely. Both P1 tag sites and the app retry are gone; explicit operator reinstall remains the only pin-replacement path. The PR body records the maintainer decision and fresh focused TypeScript/Swift proof, and states the installed-app proof gap.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 28, 2026
Include ea6bf83, which repairs the inherited ACP session metadata mock failure in PR CI. Runtime pin files are unchanged by this merge; the full PR candidate was reviewed against the exact merged main commit.
@openclaw-barnacle openclaw-barnacle Bot removed the gateway Gateway runtime label Sep 28, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review current head 7e1e601. The runtime-pin patch is unchanged; this head merges the verified main fix for the inherited ACP fixture failure. The complete six-file PR candidate has fresh clean independent review, and the PR body records the failure, main repair, and proof. Saved pins still require explicit operator reinstall for replacement.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 28, 2026
@steipete
steipete merged commit 4e97ea3 into main Sep 28, 2026
390 of 416 checks passed
@steipete
steipete deleted the steipete/app-bun-service-runtime branch September 28, 2026 11:10
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…ment (openclaw#160127)

* fix(apps): stop clearing Gateway runtime pins and pin the app's Bun

The macOS app enabled its LaunchAgent with an explicit `--runtime node`.
Since runtime pins exist, that flag clears pin intent, so every launch-agent
toggle wiped a runtime pinned with `openclaw gateway install --runtime-path`.
Drop it: the service configuration owns runtime selection, fresh installs
still default to Node, and forced reinstall keeps a pinned or recorded runtime.

When the app's resolved CLI runs under an absolute Bun executable, both the
macOS and Linux apps now pass `--runtime bun --runtime-path <bun>`, so a
Bun-only app install pins its own Bun.

* fix(apps): keep runtime pins when the macOS app enables its Gateway

Leave runtime selection with the service installer. Remove both apps' Bun
runtime-path overrides, which could replace an operator pin, while retaining
the macOS fix that omits the pin-clearing explicit runtime node selection.

Enabling preserves an installed service's pin. Disabling still uninstalls the
LaunchAgent and removes the pin. CLI fallback on Bun-only hosts is separate.

Validation: 59 focused native tests passed in an isolated test-helper run;
SwiftFormat, docs formatting, and diff checks passed. Independent review of
the complete candidate is scoped-clean for P0-P2.

* fix(apps): recover an invalid runtime pin when the macOS app enables its Gateway

Classify both CLI pin inspection and validation failures as runtime-pin-invalid
in JSON while preserving the existing human errors and exit code 1.

The macOS app keeps valid runtime pins, but retries an install once with
--runtime node when the CLI reports that typed failure. Log successful repair,
return retry failures, and leave unrelated failures unchanged.

Validation: CLI output and response tests passed 19/19 in 23.11s wall; the
install-output file passed 6 cases. Core typechecking, 60 focused native tests,
SwiftFormat, oxfmt, and whitespace checks passed. Independent P0-P2 review of
the complete candidate is scoped-clean. Both regressions failed before the fix.

* fix(daemon): only flag definitely invalid runtime pins for app recovery

Give a saved pin's changed service definition a dedicated error class. Only
that inspection failure emits runtime-pin-invalid; transient IO/SQLite and
other inspection failures remain untagged so the app preserves the pin and
returns the error without resetting runtime selection.

Keep the invalid executable classification and all human errors unchanged.
Exercise the real pin reader with an IO-like state read failure and a changed
saved definition. The transient-read regression fails before this fix.

Validation: 10 focused tests passed in 97.32s wall (7 install-output cases and
3 pin-state cases), pnpm tsgo:core, oxfmt, and whitespace checks passed. Swift
is unchanged; existing coverage rejects retries for untagged failures.

* fix(macos): keep saved Gateway runtime pins without automatic replacement

Automatic runtime retries could discard an operator pin after transient validation failures or a changed service definition. Preserve the existing explicit replacement contract by returning the CLI error and naming the reinstall action instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos cli CLI command changes docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant