Skip to content

P0: implement macOS zero-touch ChatGPT worker runtime pool #117

Description

@James3014

Status / contract rebound — Wave 2, 2026-09-16

P0 — WAVE1_EVIDENCE_COMPLETE / CONTRACT_REBOUND / G1 IMPLEMENTATION_DELTA_READY / G2–G6 BLOCKED.

Parent: #105. Tracked by #104.

The product goal is unchanged: after one-time environment authorization, James should interact only with Main while DevSpace creates/restores exact ChatGPT worker conversations, binds authenticated peers, parks/wakes workers, recovers lost browser targets, and scales the pool without manual relay.

This contract supersedes the earlier per-worker browser-process/profile requirement. That requirement was inferred from the Windows Ultra donor before macOS carrier evidence was complete. Wave 1 now provides direct macOS evidence that a single authenticated Chrome profile/session can host multiple exact ChatGPT conversations as independently addressable browser targets without cross-navigation or cross-close effects.

Current source watermark for this rebound:

James3014/devspace main = ce1fe574e1a1cdc75c6c691099d70b635a1990a7
tree = a9d23c98ecfc82fcbea0499ddb520fea14f22476

The two commits that advanced main during Wave 1 changed durable-operation recovery code only and did not change the macOS carrier implementation.


Owner UX contract

Normal use starts from one user-facing Main conversation:

James
  -> Main ChatGPT
       -> DevSpace runtime_ensure(desiredWorkers=N)
            -> attach/reuse one authorized authenticated Chrome session
            -> find/reopen/create N exact worker conversations
            -> bind each conversation to one logical worker through authenticated peer identity
            -> keep idle workers available without model polling
       -> dispatch targeted work
            -> resolve exact worker conversation
            -> obtain/rebind a current browser target handle
            -> wake exact worker
            -> worker next/execute/submit
       -> Main collect / follow-up

After one-time browser/host authorization, normal ensure / scale / recover / wake must require:

manual worker window creation   = 0
manual worker app selection     = 0
manual join/invite transfer     = 0
manual workerId/taskId transfer = 0
manual worker wake              = 0
manual result relay             = 0
manual per-worker login         = 0

One-time explicit browser remote-debugging / agent authorization is allowed when required by the supported Chrome path. Credential, CAPTCHA, quota, account-rotation, or security-control bypass is not allowed.


Wave 1 evidence basis

W1-E1 — direct CDP target isolation

On the target Mac, one managed Chrome runtime successfully held three distinct page targets. Navigating target A did not change B/C; closing B did not disturb A/C.

This proves browser-target isolation at the tab/target lifecycle layer. It does not make targetId durable worker identity.

W1-E2 — authenticated multi-conversation coexistence

An already authenticated Chrome profile successfully opened three existing ChatGPT conversations concurrently. Navigating one conversation away did not change the other two; closing one tab did not affect the remaining conversations. No prompt or tool call was sent during this witness.

W1-E3 — OpenCLI is not a reliable lifecycle dependency

During Wave 1:

opencli daemon = running
Browser Bridge extension = disconnected
opencli profile list = no connected profiles
read-only chatgpt history = BROWSER_CONNECT failure

OpenCLI remains useful as diagnostic/compatibility evidence, but is not accepted as the canonical worker lifecycle carrier.

W1-E4 — ChatGPT macOS app not selected

The ChatGPT macOS app is present and authenticated, but Wave 1 found no stable supported exact-conversation/CDP control surface suitable for DevSpace worker lifecycle. It remains unselected, not disproven forever.

W1-E5 — Chrome existing-session direction

Current Chrome 152 satisfies the version range for Chrome's supported existing-session remote-debugging / agent connection flow introduced for modern Chrome. This direction preserves the user's authenticated browser session without requiring per-worker profile/login setup. Exact DevSpace integration mechanics remain a G1 implementation question; the product contract does not require one particular MCP package or private API.


Ultra donor interpretation

Reference donor:

  • enwong93-sketch/devspace-ultra/docs/chat-swarm-classic-productization.md
  • donor revision inspected: 6d5fa4fb9669f870ea15d43a2b6aba4678a38a97

Ultra proves the product/lifecycle invariants:

  • Main-only normal UX;
  • setup/login complexity absorbed by controller logic;
  • exact durable worker conversation mapping;
  • backend remains worker/task authority;
  • UI automation is lifecycle/bootstrap/recovery only;
  • idempotent ensure;
  • paced provisioning;
  • exact recovery;
  • no blind replay after unknown external effects.

Ultra's Windows AppX/package/profile isolation is not a macOS requirement. The macOS implementation SHALL use the lightest isolation layer that physical evidence proves sufficient and SHALL escalate to browser-context/profile/process isolation only if later evidence falsifies target/conversation isolation.


Frozen identity / authority model

These identities are distinct:

logical workerId
!= ChatGPT conversation ID / URL
!= conversation fingerprint
!= authenticated MCP peer/session fingerprint
!= browser targetId / CDP sessionId
!= browser process PID
!= Chrome profile identity

Durability boundary:

DURABLE / authoritative mapping
logical workerId
<-> exact conversation identity
<-> authenticatedPeerFingerprint
<-> Swarm task/attempt/result state

EPHEMERAL browser-generation handle
targetId / CDP sessionId

targetId may disappear or change after tab close/reopen or browser restart. Recovery SHALL re-resolve or reopen the exact persisted conversation and obtain a fresh target handle; it SHALL NOT mint a new logical worker merely because a target disappeared.

Authority remains:

Chat Swarm durable store
  = worker/task/attempt/result/reconciliation authority

Mac browser carrier
  = host lifecycle + exact conversation addressing + wake/recovery transport

Browser/UI/CDP/OpenCLI
  = transport/observation only

Browser state must never mint task, retry, merge, repository, or completion authority.

OUTCOME_UNKNOWN != retry permission remains mandatory.


Required primary macOS topology

The first implementation candidate SHALL target:

DevSpace Chat Swarm
        |
        v
MacWebChatCarrierAdapter
        |
        v
Authorized existing authenticated Chrome session
        |
        +-- Worker-01
        |    exact conversation A
        |    current ephemeral target handle A
        |
        +-- Worker-02
        |    exact conversation B
        |    current ephemeral target handle B
        |
        +-- Worker-03
             exact conversation C
             current ephemeral target handle C

The browser connection mechanism SHALL be a supported bounded existing-session control path with explicit user authorization. Do not depend on mutating the user's normal Chrome launch command with legacy --remote-debugging-port against the default data directory.

Escalation rule

Per-worker browser context/profile/process isolation is not required by default.

Escalate only if a later live witness proves one of these cannot be controlled safely at conversation/target isolation:

  • exact target addressing;
  • independent navigation/close/reopen;
  • authenticated peer identity;
  • recovery after target loss;
  • concurrent targeted wake;
  • account/host state separation required for correctness.

Any escalation requires a new evidence-bound contract delta; do not silently strengthen isolation in implementation.


Brownfield source delta audit

PRESERVE — no redesign required

The following current behavior remains part of the accepted architecture and should be reused unless implementation evidence finds a bounded defect:

PRESERVE WITH REBIND — existing CdpMacWebDriver

Current CdpMacWebDriver already models one CDP endpoint with multiple exact targets and supports:

newTarget(projectUrl)
openOrReuse(exact conversation URL)
close exact target
wait for composer
observe conversation URL
send to exact target
recover exact conversation

This shape is directionally aligned with Wave 1 evidence and should not be replaced by a per-worker browser-runtime manager.

Required rebind: its connection/launch boundary must support the selected authorized existing-session Chrome path rather than assuming DevSpace owns a dedicated --user-data-dir runtime whenever preflight is unavailable.

MODIFY — browser connection ownership

Current CDP startup fallback launches Chrome with:

--remote-debugging-port=<port>
--user-data-dir=<managed profile dir>

That remains a bounded fallback for a dedicated managed browser profile, but it SHALL NOT be the canonical normal UX after Wave 1.

G1 must introduce or adapt a connection seam that can:

preflight existing authorized Chrome control session
attach/reconnect without copying session secrets
observe exact targets
open/reopen exact ChatGPT conversation targets
classify authorization/setup-required separately from worker failure

The exact library/process used to obtain that connection is an implementation choice to be proven in G1; #117 does not grant permission to use hidden OpenAI APIs or bypass Chrome's authorization UI.

MODIFY — target lifecycle representation

Persisted registry SHALL NOT treat browser target/session IDs as durable identity.

If target/session generation metadata is recorded for diagnostics, it must be explicitly ephemeral and replaceable.

Recovery semantics:

slot has exact conversation identity
-> inspect current browser targets
-> reuse exact target if present
-> otherwise reopen exact conversation
-> obtain new target/session handle
-> revalidate host/app + authenticated peer identity
-> resume same logical worker

MODIFY — setup/readiness classification

Browser readiness and worker readiness must remain distinct.

At minimum classify:

BROWSER_AUTHORIZATION_REQUIRED
BROWSER_CONTROL_UNAVAILABLE
CHATGPT_SIGNED_OUT
HOST_APP_BINDING_NOT_READY
PEER_IDENTITY_UNRESOLVED
CONVERSATION_IDENTITY_DRIFT
RECONCILE_REQUIRED

A browser target existing is not enough for worker health.

MODIFY — app label/config drift

The current operational DevSpace App/MCP name is dev.

Any source/docs default still referring to dev-c must be audited in G1. Do not silently change unrelated compatibility aliases unless current consumers are verified.

DOWNGRADE — OpenCLI

OpenCliMacWebDriver MAY remain as an optional diagnostic/compatibility adapter while G1 is implemented.

It SHALL NOT be the canonical lifecycle path for:

  • pool creation;
  • worker recovery;
  • scale up/down;
  • cold reconstruction;
  • acceptance of G2–G6.

Do not delete it merely to simplify the first corrective PR; removal requires separate evidence that no supported consumer needs it.

PARK — ChatGPT macOS app

No G1 implementation effort should target the ChatGPT Mac app unless a supported exact-conversation control seam is newly proven and materially better than Chrome.

REMOVE FROM CONTRACT — per-worker browser process/profile requirements

The following previous requirements are superseded:

  • one browser process per logical worker;
  • one dedicated profile/user-data-dir per logical worker;
  • one CDP endpoint per logical worker;
  • process death of one worker as the primary G4 failure model;
  • three separate authenticated browser runtimes as a prerequisite to G2.

They remain historical evidence only.


G1 required implementation delta

Implement the minimum source delta necessary to bind the existing runtime manager to the Wave 1 proven model.

Expected responsibility boundary:

MacChromeControlSession
  preflight()
  authorization/readiness status
  listTargets()
  newTarget(url)
  openOrReuseExactConversation(url)
  closeExactTarget(url/target)
  evaluateExactTarget(...)
  reconnect/rebind after browser generation change

Names are not normative. Avoid creating a second worker/task/runtime authority.

The implementation SHALL preserve injectable/fake driver tests and the existing MacWebDriver seam unless a smaller compatible change is demonstrably better.

G1 hostile controls

At minimum:

  • operation on target A cannot navigate/close target B;
  • stale targetId does not become durable identity;
  • target lost -> exact conversation reopen -> same logical worker;
  • wrong conversation attempts managed-slot admission -> rejected;
  • changed conversation identity under one provisioning operation -> rejected/reconcile;
  • response lost after conversation creation -> exact readback before any replacement;
  • bootstrap acknowledgement unknown -> no duplicate conversation/worker;
  • identical concurrent ensure(N) -> no duplicate logical workers/conversations;
  • browser control disconnect -> no blind resend;
  • browser reconnect does not auto-requeue potentially started task;
  • signed-out/authorization-required/app-disabled are setup/host failures, not task failures;
  • busy/reconcile-required worker cannot scale down;
  • corrupted runtime registry fails closed without deleting Swarm/task truth;
  • OpenCLI cannot silently become canonical through configuration fallback.

Revised gate sequence

G0 — macOS carrier evidence

PASS — Wave 1.

Evidence supports one authenticated Chrome session with multiple exact conversation/target carriers as the first candidate. OpenCLI-primary rejected; per-worker profile/process isolation not required by current evidence.

Required claim:

MACOS_CONVERSATION_TARGET_ISOLATION_WITNESS_PASS

G1 — source implementation + independent acceptance

Implement only the connection/control delta above against fresh main.

Required before merge:

  • exact base/head/diff;
  • existing-session control abstraction tests;
  • exact target/conversation negative controls;
  • reconnect/reopen tests;
  • existing admission/task/replay/reconciliation regression;
  • OpenCLI downgrade preserved;
  • typecheck/build/focused tests/full practical macOS CI;
  • independent Candidate acceptance;
  • exact-head merge.

Source/test success is not live acceptance.

G1D — exact canary deployment

Deploy exact accepted merged build and bind:

source commit/tree
build ID
server instance ID
state root
host-visible MCP schema
Chrome/browser version
browser-control mechanism + generation
configured project/app identity

G2 — zero-touch create/bind

From Main only, on a fresh Swarm:

runtime_ensure(desiredWorkers=3)

Require:

  • exactly 3 healthy logical workers;
  • exactly 3 distinct exact ChatGPT conversations;
  • each has a distinct current browser target handle when active;
  • all map to distinct authenticated peer identities as required by admission;
  • manual worker interaction = 0;
  • repeat ensure(3) creates 0 new workers/conversations/effects.

G3 — exact targeted execution

Dispatch one bounded targeted task to each worker.

Require:

durable assignment
-> exact conversation resolution
-> current target reuse/reopen
-> exact worker wake
-> next/claim
-> execute
-> submit
-> Main durable collect

Cross-worker attribution = 0; duplicate execution = 0; manual relay = 0.

G4 — recover one worker carrier

Close/lose exactly one worker conversation target, not the whole browser profile.

Require:

  • other worker conversations remain untouched;
  • exact persisted conversation is reopened/re-resolved;
  • target handle may change;
  • authenticated peer/logical worker continuity is preserved;
  • unknown task effects remain RECONCILE_REQUIRED.

G5 — elastic scale

Prove:

3 -> 5 -> 2

Scale-up adds only missing logical workers/conversations. Scale-down retires only safe idle workers and never evicts busy, targeted, continuation-pending, or reconcile-required workers.

G6 — cold browser/control reconstruction

With durable mappings present:

  1. lose/restart the browser control connection or browser generation through the supported path;
  2. keep durable Swarm/runtime registry state;
  3. reconnect to the authorized Chrome session;
  4. call one runtime_ensure(desiredWorkers=<target>);
  5. rediscover or reopen exact saved conversations;
  6. obtain fresh target handles;
  7. prove no duplicate logical workers/conversations and no blind replay of unknown effects.

A full user-profile logout/login cycle is not required for G6 unless the selected supported browser-control mechanism makes it unavoidable.


Non-goals


Execution / review boundary

This is architecture/lifecycle-sensitive P0 work.

claim_mode = MANUAL_DISPATCH
AUTO_CHAIN = false

Implementation must rebind fresh main, current Chrome/browser-control evidence, production DevSpace identity, and overlapping #117 work before mutation.

Candidate implementation cannot self-accept, self-merge, deploy, or close this Issue.


Exact next gate

G1_EXISTING_AUTHENTICATED_CHROME_CONTROL_SOURCE_DELTA

Implement the smallest supported connection/control change needed for DevSpace to address exact ChatGPT conversations inside one explicitly authorized existing authenticated Chrome session. Preserve all current Swarm/task authority and use per-worker profile/process isolation only if new live evidence falsifies the Wave 1 target-isolation result.

Claim ceiling

Current maximum claim:

WAVE2_CONTRACT_REBOUND_COMPLETE — MACOS_ZERO_TOUCH_WORKER_RUNTIME_NOT_YET_LIVE_PROVEN

Only after G1 + G1D + G2 + G3 + G4 + G5 + G6 all pass on exact evidence may #117 close with:

MACOS_ZERO_TOUCH_CHATGPT_WORKER_RUNTIME_CANARY_PASS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions