Skip to content

P0: macOS elastic ChatGPT worker runtime lifecycle (zero-touch ensure/wake/recover/scale) #105

Description

@James3014

Parent

Child of #104 (DevSpace Ultra parity reconciliation).

Priority

P1 — required for Ultra-style normal UX after peer-swarm baseline is proven.

Current #46#49 cover Swarm state/protocol/tooling/live peer baseline. Current #50 is an optional OpenCLI transport experiment. Neither currently owns the full worker carrier lifecycle needed for the Ultra-style experience where the user/main GPT does not manually prepare every worker conversation.

Goal

Provide one bounded macOS worker-carrier lifecycle abstraction so a Main ChatGPT orchestrator can ensure/resume usable ChatGPT worker capacity, then let Chat Swarm remain the task-routing authority.

Behavioral target:

Main GPT
  -> ensure worker capacity N
  -> start/create/resume supported worker carriers as needed
  -> bind/join them to Chat Swarm
  -> park idle workers without model polling
  -> wake exact worker when targeted work arrives
  -> recover stale/lost carrier without changing logical worker identity
  -> scale up/down safely

The user should not need to copy invite codes/prompts between worker conversations during normal operation once the chosen carrier adapter is configured and admitted.

Ultra reference boundary

Ultra proves the behavior using Windows ChatGPT Classic isolated runtimes, CDP/bootstrap, saved conversation mappings, runtime ensure, recovery, and worker wake paths.

DevSpace macOS MUST NOT copy Windows-specific mechanics as architecture:

  • no AppX/package-clone assumptions;
  • no Windows chatgpt:// ownership/provisioning logic;
  • no cookie/session cloning as authority;
  • no forced adoption of browser automation if the current platform/runtime does not support a safe bounded carrier;
  • no browser state as Swarm/task authority.

The first gate is therefore carrier capability discovery, not implementation by analogy.

Relationship to #50

#50 remains the bounded optional OpenCLI ChatGPT runtime adapter experiment.

This Issue owns the higher-level lifecycle contract:

WorkerCarrierManager
  ensure
  status
  start/create-or-bind
  wake
  park
  recover
  scale
  stop/release

#50 may become one adapter underneath this contract if fresh macOS evidence supports it. A native MCP-peer or another supported carrier may also satisfy the contract. Do not make OpenCLI the Swarm authority.

Required architecture

Chat Swarm durable truth
  workerId / taskId / attemptId / queue / result
        |
        v
Worker Carrier Lifecycle
  runtime/carrier health + wake/recover only
        |
        +--> native MCP peer carrier
        +--> OpenCLI/web carrier (#50 candidate)
        +--> other bounded supported carrier

Carrier state must never grant/revoke task authority by itself.

Required semantics

1. Stable logical identity

workerId != carrier/conversation ID.

Carrier replacement/recovery must preserve the existing logical worker only through an explicit #51-compatible continuation/rebind contract.

2. Ensure

A bounded ensure equivalent must:

  • inspect required worker capacity;
  • reuse healthy already-bound workers;
  • create/start only missing capacity;
  • avoid duplicate worker creation under replay;
  • return exact logical worker + carrier binding state;
  • be idempotent for the same requested capacity/config.

3. Wake / park

Normal idle workers should not burn model turns polling.

The runtime should support a bounded wake signal/event when work becomes available. If the selected carrier cannot be server-pushed/woken safely, expose that limitation explicitly rather than emulating busy polling.

4. Recovery

For stale/lost carrier:

carrier lost
!= worker lost
!= task failed
!= retry safe

Recovery must first inspect Swarm task/attempt state. If a task may have started or an external effect is unknown, preserve RECONCILE_REQUIRED; do not create a fresh worker attempt blindly.

5. Scaling

Scale-up may add idle logical workers/carriers within configured limits.

Scale-down must refuse to evict workers that are:

  • executing;
  • holding a targeted queued task;
  • in continuation/reconciliation;
  • otherwise required by an unresolved external effect.

Prefer tail/explicit worker retirement with deterministic identity handling; do not reshuffle live ownership silently.

6. Exact carrier evidence

Receipts/status must distinguish:

  • logical worker ID;
  • carrier kind;
  • carrier/conversation fingerprint or bounded identifier;
  • current binding epoch;
  • online/parked/busy/reconcile-required state;
  • source/build/capability identity of Dev MCP;
  • adapter/runtime version when relevant.

Do not expose credentials or raw secret session material.

Required tool surface

Exact names may follow repository conventions, but provide equivalents of:

chat_swarm_runtime_status     # read-only
chat_swarm_runtime_ensure
chat_swarm_runtime_recover
chat_swarm_runtime_scale
chat_swarm_runtime_stop       # owned carriers only

If wake/park are internal lifecycle operations, they still need observable state/tests.

Gate sequence

G0 — macOS carrier feasibility / support matrix

Freshly test what can actually provide isolated/resumable ChatGPT worker carriers on the target Mac:

For each record: create/bind, targeted send/wake, result readback, conversation identity, reconnect/restore, concurrency, cancellation/reconciliation limits.

Do not implement a Windows clone substitute without evidence.

G1 — lifecycle contract + fake/injected adapter

Implement deterministic manager semantics independent from one real carrier.

G2 — first real macOS carrier adapter

Bind the smallest proven carrier behind the contract.

G3 — zero-copy / no-manual-bootstrap witness

Main creates/ensures >=2 worker capacity without the user copying task/invite text between chats.

G4 — targeted wake + recovery

Park both workers, target one exact worker, prove only it wakes/claims; then lose/recover that carrier while preserving logical identity and task truth.

G5 — elastic scale witness

Scale 2 -> 3 -> 2 with no busy/targeted worker eviction and no lost/duplicate work.

Required tests / hostile controls

  • exact replay of ensure creates no duplicate worker;
  • conflicting ensure/config identity fails closed;
  • two logical workers never bind the same live carrier unless explicit sharing semantics exist;
  • one worker cannot adopt another worker's carrier continuation;
  • busy worker cannot be scaled out;
  • unknown task effect blocks destructive recycle/replacement;
  • carrier restart/loss never auto-requeues potentially started work;
  • old carrier is fenced after successful feat(chat-swarm): add durable worker continuity and conversation rollover #51 continuation rebind;
  • Dev MCP restart preserves lifecycle state/projection without minting task truth;
  • carrier failure does not corrupt Swarm queue/result state.

Dependencies

Non-goals

  • no Windows runtime cloning;
  • no credential/session-cookie copying;
  • no CAPTCHA/rate/quota bypass;
  • no automatic model/account rotation;
  • no Nexus Planner/Workforce/Completion authority;
  • no repository mutation authority merely because the worker carrier exists;
  • no claim of automatic ChatGPT carrier creation if the selected macOS transport cannot support it.

Exact next gate

DEVSPACE_ULTRA_WORKER_RUNTIME_G0_MACOS_CARRIER_MATRIX

Prove the supported macOS carrier options and freeze the first real adapter before implementing platform-specific lifecycle automation.

Claim ceiling

WORKER_CARRIER_LIFECYCLE_CONTRACT_PLANNED — MACOS_REAL_CARRIER_NOT_YET_PROVEN

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions