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(toggles): Codex restore truth, Claude Desktop switch, composed acceptance (WP13 resume) by lidge-jun · Pull Request #1106 · lidge-jun/opencodex

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Aug 6, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Owner

Summary

Resumes the paused WP13/WP14 tail of the Codex write-substrate campaign: the Codex CLI toggle gets artifact-level restore truth, Claude Desktop gets a real ON/OFF toggle with a documented standard-mode pivot, and a composed acceptance suite proves the production entry points reach the substrate instead of writing around it.

  • Codex toggle completion (devlog/_plan/260803_codex_desktop_toggle/040 as amended by 260806_wp13_toggles_resume/010): ocx restore/eject persist desired OFF before mutating (crash-durable), restore back/eject back persist ON; restoreNativeCodexAsync returns a per-artifact {config, catalog, history} envelope where history failure carries a busy | permission discriminator instead of being folded into success; every syncModelsToCodex caller (startup, ensure, sync, restore dispatch, models, provider, POST /api/sync, toggle enable) branches on a discriminated applied/skipped/refused status; desired state is re-read inside each artifact serializer (write lock, history serialization, catalog commit, cache reacquisition) so a lost race becomes a typed skip, never a stale write.
  • Claude Desktop toggle (050 as amended by 020): claude-desktop joins clientIntegrations and the native route union; a read-only inspector classifies not_installed/standard/gateway_ours/gateway_drifted/foreign/no_owned_state/broken/unsafe with an ownership boundary (owned-but-drifted refuses as unsafe; reads never create files); OFF pivots to a credential-free {} standard profile before removing the opencodex profile, its backup, and its metadata row; all four writer paths (auto-apply, native enable, POST /apply, no-daemon CLI apply) re-read persisted intent after their awaits; desiredEnabled is required on post-commit refusals for every client; GUI switch with six-locale copy.
  • Composed acceptance (issue WP13: composed acceptance at the production boundary #1048, reduced workstation scope per 030): tests/codex-composed-acceptance.test.ts runs six scenarios through real spawned CLI children and a real HTTP server on temp homes — entry-to-funnel manifests, lost transition via HTTP, foreign-home zero-artifact refusal, same-user cross-home single lock, Grok OFF surviving a real restart, and restore truth via the new ocx restore --json. Building it exposed four real production holes (OFF paths creating artifacts in CODEX_HOME, POST /api/sync trusting the server-captured config, foreign homes accepted over HTTP, opaque busy results), all fixed here. The disposable-host service class (P09/P10/P18/P34-P36) and remaining census rows stay deferred; WP13: composed acceptance at the production boundary #1048 remains open (referenced, not closed).

Verification

  • bun x tsc --noEmit — clean at every commit.
  • bun scripts/test.ts (full suite) — 9242 pass / 8 skip / 1 fail; the single failure (issue-quality workflow rejects workflow_dispatch pull request numbers before mutation in tests/ci-workflows.test.ts) is pre-existing on origin/dev (reproduced on a clean detached worktree at e496e9bfe) and untouched by this branch (git diff origin/dev...HEAD touches no workflow files).
  • bun run lint:gui, bun run privacy:scan, bun run build:gui — green.
  • Composed suite stable across 3 consecutive runs; six per-scenario broken-change proofs executed (mutate mechanism → red, restore → green, clean diff).
  • Live temp-home proof: PUT /api/native-integrations/claude-desktop OFF on a not_installed home returns an idempotent no-op with zero filesystem footprint and persisted clientIntegrations["claude-desktop"]: false; GET lists all four clients.
  • Independent review: every work-phase was audited by a reviewer subagent that did not write the code; all blockers across seven review rounds were fixed or rebutted with evidence before close.

GUI change screenshot (Integrations overview with the Claude Desktop switch and the four native rows):

integrations overview

Related: #1048 (stays open — workstation subset landed here, service-class scenarios still deferred).

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed (devlog unit 260806_wp13_toggles_resume/ documents the roadmap, amendments, and deferred rows).
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults (credential-bearing Desktop profiles are removed on disable and never echoed into envelopes, logs, or tests; lock ids disclose only path hashes).

Summary by CodeRabbit

  • New Features

    • Added Claude Desktop integration toggling, status reporting, enable/apply actions, and localized messages.
    • Added persistent desired-state controls for Codex, Claude Desktop, and Grok.
    • Added clearer synchronization and restore outcomes, including skipped, refused, failed, and incomplete states.
    • Added safeguards for foreign configurations, unsafe metadata, cleanup residue, and concurrent changes.
  • Bug Fixes

    • Prevented disabled integrations from writing configuration or cache updates.
    • Improved restore reporting while preserving externally managed profiles.
    • Added warnings when applied settings cannot be fully persisted.
  • Tests

    • Expanded coverage for toggles, races, cleanup, restoration, isolation, and CLI behavior.

Sorry, something went wrong.

Uh oh!

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

All reactions
lidge-jun added 30 commits August 6, 2026 11:21
@lidge-jun
docs(devlog): 260806 WP13/WP14 resume plan — stale-checked roadmap, P…
480a9fe
…R-only boundary
@lidge-jun
docs(devlog): 260806 plan r2 — audit blockers folded in (reads non-mu…
d69f05f
…tating today, full sync-caller gating, workstation-only 030 leaves #1048 open)
@lidge-jun
docs(devlog): 260806 plan r3 — the enable path is a syncModelsToCodex…
0cfeda0
… caller too
@lidge-jun
docs(devlog): 010 amendments — write-lock revalidation replaces the p…
813375f
…hantom coordinator; OFF path stays async
@lidge-jun
docs(devlog): 010 r2 — per-artifact serializers own revalidation; cat…
9971d2b
…alog joins the restore envelope
@lidge-jun
feat(codex): expose native restore artifact outcomes
1d02e2c
@lidge-jun
feat(codex): distinguish skipped sync outcomes
96191c6
@lidge-jun
feat(codex): revalidate desired state under artifact locks
e483171
@lidge-jun
feat(cli): persist Codex restore intent before mutation
b45f05d
@lidge-jun
test(codex): cover desired-state toggle outcomes
3906440
@lidge-jun
fix(codex): keep external-provider restore free of history work
5788def
@lidge-jun
fix(codex): serialize restore config writes under the write lock
d213731
@lidge-jun
fix(codex): re-read desired state inside the catalog commit
134956b
@lidge-jun
test(codex): behavioral coverage for lost-transition and restore gating
f11bb6d
@lidge-jun
fix(codex): gate the cache reacquisition write on desired state
9c6fc9b
The commit-path OFF check runs under the first catalog permit; the
models_cache rewrite reacquires K after release, so a disable landing in
the gap could still publish a routed cache. Re-read intent under the
second permit too.
@lidge-jun
docs(devlog): 020 amendments — Desktop toggle adapted to the real thr…
4167b86
…ee-client contract
@lidge-jun
docs(devlog): 020 r2 — desiredEnabled widening, full inspector state …
d66e764
…set, transport-liveness test restored
@lidge-jun
docs(devlog): 020 r3 — owned-but-drifted credentials are unsafe, not …
4ce7c8d
…foreign
@lidge-jun
feat(claude): add Desktop desired-state schema
bab425e
@lidge-jun
feat(claude): inspect and safely remove Desktop gateway profiles
f1803c9
@lidge-jun
feat(claude): add Desktop native integration toggle
7f1220b
@lidge-jun
feat(claude): gate Desktop auto-apply on persisted intent
9e7e699
@lidge-jun
feat(gui): expose Claude Desktop desired toggle state
b6378e1
@lidge-jun
test(claude): cover Desktop standard-mode removal
0b97b91
@lidge-jun
test(claude): close Desktop toggle regression coverage
f4607d5
@lidge-jun
fix(claude): restore the tri-state activeProfile contract on Desktop …
c002b5f
…status

The inspector now carries ownedProfileActive (ID-match tri-state, null when
metadata or appliedId is absent/unreadable) so the status route stops
flattening undeterminable into false.
@lidge-jun
fix(claude): gate Desktop cleanup by selected ownership
67ebfb7
@lidge-jun
fix(management): fence Desktop toggle writers
1208f46
@lidge-jun
fix(cli): fence the no-daemon Desktop apply behind a post-await inten…
e53752e
…t re-read
@lidge-jun
fix(gui): make the Desktop toggle build under tsc, not just bun test
bac8eb9
The toggle field names the API wire id (claude-desktop) which is not an
OverviewClientId; widen the union explicitly. The status parser narrowed on
fields absent from its readOptional shape.
lidge-jun added 2 commits August 6, 2026 16:15
@lidge-jun
test(fixtures): make Linux service ownership explicit
4d22be4
@lidge-jun
test(ci): the Copilot migration swapped models:read for copilot-reque…
39f452a
…sts:write

Pre-existing red on origin/dev (run 31078958589 and a clean dev worktree
both fail it); the permissions gate now matches the migrated workflow.
Ingwannu
Ingwannu requested changes Aug 6, 2026
View reviewed changes

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This campaign is high-value, but the current head must be rebased before I can approve it.

The important boundaries are in the right place: OFF intent is persisted before mutation; config/history/catalog/cache writers re-read intent inside their serialization boundary; restore returns artifact-level truth instead of folding history failure into success; Claude Desktop removal pivots to a credential-free standard profile and refuses owned-but-drifted state; and the composed suite drives real CLI/HTTP entry points rather than only helpers. Those are meaningful correctness improvements, not cosmetic toggle work.

Current blocker: head 39f452ac is 8 commits behind dev and GitHub reports it conflicting. I reproduced the merge against a5b37827; the only conflict is tests/ci-workflows.test.ts. Current dev intentionally accepts either copilot-requests: write or the migration-era models: read, while this branch re-tightens the assertion to Copilot only. Please rebase onto current dev and keep the current dev assertion unless the workflow itself is being changed in this PR. The source/runtime changes merge without conflict.

Local current-dev merge validation after resolving that test conflict with the dev version:

  • 12 focused Codex/Claude Desktop toggle, restore, sync, lock, and composed suites: 100 passed; one native-codex-toggle case exceeded its 5 s timeout under the concurrent CPU-limited run and caused 3 cascading failures
  • isolated rerun of tests/native-codex-toggle.test.ts: 6 passed, 0 failed (the timed case completed in 180 ms)
  • bun run typecheck: passed

Because this touches credential-bearing Desktop profiles, persistent desired state, cross-process locks, management writers, and GUI controls, the rebased exact head needs the full required CI and GUI gates before approval. Please rebase rather than merge dev into the branch again, rerun the suite, and request review on the new SHA.

Sorry, something went wrong.

Uh oh!

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

All reactions
lidge-jun added 4 commits August 6, 2026 21:32
@lidge-jun
Merge remote-tracking branch 'origin/dev' into codex/260806-wp13-toggles
8c231ea
# Conflicts:
#	tests/ci-workflows.test.ts
@lidge-jun
fix(claude): stop POST /apply from cancelling its own enable
bdd12a9
The route persisted desired ON, then saved the whole long-lived server
snapshot -- whose clientIntegrations still said OFF -- back over it, so its
post-await guard refused the apply it had just been asked to perform.
Persist only the desktopProfile field under the config-mutation lock, and
route the writer through the deps seam its sibling path already uses.
@lidge-jun
fix(claude): keep the server snapshot coherent after a Desktop enable
d9d5554
setIntegrationEnabled writes disk only, and the server reuses one config
object per request, so the native GET reported OFF right after a successful
apply and the profile PUT wrote that stale OFF back. Mirror the transition
onto the snapshot, and surface an unavailable profile mutation instead of
dropping it.
@lidge-jun
fix(gui,cli): surface the partial-success apply instead of a clean su…
38d3834
…ccess

The route already reported saved:false with a warning when the applied
marker failed to persist, but both front ends discarded it and announced a
clean save+apply. GUI shows a warn-tone notice (six locales), CLI prints the
warning after a successful apply.
coderabbitai[bot]
coderabbitai Bot reviewed Aug 6, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/server/management/agent-settings-routes.ts (1)

177-208: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Use field-scoped persistence for auto-apply bookkeeping.

saveConfigPreservingClaudeCode(current) writes the complete current snapshot after the Desktop artifact write. A concurrent process can change clientIntegrations or another config field after Line 189. This save can restore the stale value.

Use persistDesktopProfileField to store only claudeCode.desktopProfile with the new fingerprint and timestamp. That helper rebases against current disk state under the config mutation lock.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/server/management/agent-settings-routes.ts` around lines 177 - 208,
Replace the full-snapshot saveConfigPreservingClaudeCode call in the
result.written && result.fingerprint block with persistDesktopProfileField,
passing the updated claudeCode.desktopProfile fingerprint and timestamp.
Preserve the existing bookkeeping values while ensuring persistence is scoped
only to claudeCode.desktopProfile.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/server/management/agent-settings-routes.ts`:
- Around line 177-208: Replace the full-snapshot saveConfigPreservingClaudeCode
call in the result.written && result.fingerprint block with
persistDesktopProfileField, passing the updated claudeCode.desktopProfile
fingerprint and timestamp. Preserve the existing bookkeeping values while
ensuring persistence is scoped only to claudeCode.desktopProfile.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 766ba33f-3b44-4830-b844-084abb919520

📥 Commits

Reviewing files that changed from the base of the PR and between 39f452a and 38d3834.

📒 Files selected for processing (15)
  • gui/src/i18n/de.ts
  • gui/src/i18n/en.ts
  • gui/src/i18n/ja.ts
  • gui/src/i18n/ko.ts
  • gui/src/i18n/ru.ts
  • gui/src/i18n/zh.ts
  • gui/src/pages/ClaudeDesktop.tsx
  • gui/src/ui.tsx
  • src/cli/claude-desktop.ts
  • src/config.ts
  • src/server/management/agent-settings-routes.ts
  • src/types.ts
  • tests/ci-workflows.test.ts
  • tests/claude-messages-endpoint.test.ts
  • tests/native-claude-desktop-toggle.test.ts

Sorry, something went wrong.

Uh oh!

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

All reactions
@lidge-jun
lidge-jun merged commit 43a1fdc into dev Aug 6, 2026
30 checks passed

Uh oh!

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

@lidge-jun lidge-jun mentioned this pull request Aug 6, 2026
fix(test): give the contended restore its real production wait budget #1129
Merged
3 tasks done
lidge-jun added a commit that referenced this pull request Aug 6, 2026
@lidge-jun
Merge pull request #1129 from lidge-jun/codex/260806-restore-watchdog…
e9d957b
…-margin

Restores dev to green after #1106: the contended-restore case needed a watchdog wide enough for production's own retry budget. Test-only.
@luvs01 luvs01 mentioned this pull request Aug 7, 2026
[WRONG BRANCH] fix(codex): preserve external history on async restore luvs01/opencodex#10
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 7, 2026
fix(codex): stop reporting every history failure as a Codex DB lock #1202
Merged
7 tasks done
@lidge-jun
lidge-jun deleted the codex/260806-wp13-toggles branch August 8, 2026 00:49
This was referenced Aug 8, 2026
feat: add enable/disable toggle for Claude Desktop routing #1291
Closed
fix(codex): make history no-op detection atomic #1294
Closed
fix(management): harden native toggle request handling #1264
Closed
fix(claude): honor Desktop native model opt-out #1363
Merged
fix(codex): honor split SQLite state homes #1425
Merged
This was referenced Aug 11, 2026
WP13: composed acceptance at the production boundary #1048
Closed
[Feature/UX]: add additive Claude Desktop catalog mode with honest native/OpenCodex switching #1213
Closed
This was referenced Aug 13, 2026
OpenCode integration dead-ends in permanent 'conflict' after any unrelated user edit to opencode.json (e.g. adding an MCP server) #1631
Closed
ocx stop/restore leave unmarked openai_base_url + proxy models_cache behind when Codex app rewrote config after injection #1798
Closed
[Feature]: Add Claude Science client integration support #1811
Closed
[Bug] ocx config set / ocx config import bypass the protected 3-way reconcile and can clobber concurrent disk / hand edits #1838
Closed
[Compatibility] Cursor Computer Use / node_repl tool results come back empty or truncated #1866
Closed
fix(claude): gate shell hook on CLI installation #2105
Closed
@lidge-jun lidge-jun mentioned this pull request Aug 25, 2026
feat(acceptance): disposable-host service acceptance and the uninstall bug it found (#1048) #2618
Merged
4 tasks done
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@lidge-jun
Merge pull request lidge-jun#1106 from lidge-jun/codex/260806-wp13-to…
17a0c48
…ggles

Merging the WP13/WP14 toggle resume after an independent completeness audit (4 rounds) closed three real defects: the self-cancelling /apply enable, in-process snapshot incoherence, and an unconsumed partial-success envelope. Issue lidge-jun#1048 stays open for the deferred disposable-host census rows.
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@lidge-jun
Merge pull request lidge-jun#1129 from lidge-jun/codex/260806-restore…
e614fad
…-watchdog-margin

Restores dev to green after lidge-jun#1106: the contended-restore case needed a watchdog wide enough for production's own retry budget. Test-only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments
@Ingwannu Ingwannu Ingwannu requested changes
@Wibias Wibias Awaiting requested review from Wibias

Uh oh!

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

Assignees

No one assigned

Labels

enhancement New feature or request

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.

2 participants

@lidge-jun @Ingwannu
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 01402775 — 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.