Skip to content

v0.81.1

Choose a tag to compare

@davidfarah-dev davidfarah-dev released this 13 Oct 17:17
8787548

Cotal 0.81.1 is out. It fixes the Claude Code disconnects.

Upgrade: npm i -g cotal-ai@0.81.1 (or cotal update --self on an installed 0.79.0). Running sessions keep the old connector until Claude Code restarts the server, so reconnect once with /mcp after upgrading, and restart cotal up.

The Claude Code connector stays connected

Claude Code users on a space that requires the event plane saw MCP server cotal has disconnected, and the connector only came back on the next tool call. Two causes, both fixed in this release:

  • The connector no longer exits when the event plane fails. Any event-plane failure used to end the seat with exit code 1. The connector now keeps its mesh connection and re-establishes the plane itself: at once after the failure, then every second while it stays down, so the plane is back within a second of the fault clearing. Whatever the outage left pending is settled and published once the fault clears, and a turn that ends during an outage keeps its terminal. The same change covers the OpenCode, Codex, jcode and pi connectors.
  • A torn transcript line no longer halts the event reader for good. A write cut short by a full disk left part of one record glued to the next on a single line. The reader halted on that byte, every restart died at the same place, and the connector exited with it. The reader now steps over an unreadable line, reports it with its offset and length, and reads on.

Verified with a real Claude Code seat on a scratch mesh: its event log was made unwritable mid-turn and a torn line was appended to its transcript. It never disconnected, answered every message, and published the turn written under the fault once the fault was cleared.

Also in this release

  • Managed Claude Code seats launch with --permission-mode bypassPermissions by default, so a seat no longer stalls on a permission prompt nobody can answer. Pass --opt permission-mode=default to get prompts back.
  • A Claude Code seat whose run turn passed a permission prompt now yields done when the turn ends, instead of leaving the run step pending.
  • Authorized managed Claude Code launches accept the workspace trust dialog at startup.
  • The OpenCode plugin holds a native prompt behind every turn end still settling, drives pending work when a 2.x turn ends, and refuses a required-events registration on the 2.x adapter instead of running without a plane.
  • The manager keys each spawn acceptance by caller and goal id, reads the config once per spawn, and shreds a delegated seat's secret family at its retirement.
  • cotal spawn -f reports a partial deploy and exits 1 when any launch fails. A failed foreground cotal spawn retires its broker footprint. cotal up stops the broker it spawned when it cannot publish its pid.
  • cotal down --preserve-state refuses a presence row whose card id differs from its key. cotal actor revoke prints verified gone only on a well-formed eviction reply. An empty list flag on spawn and mint reads as an empty list.
  • A manager restart in the same second as an earlier credential issuance no longer fails with conflict.
  • Core validates JSON object members as own properties and validates channel registry entries on the read side.

This release also carries everything versioned as 0.80.0 and 0.81.0, which never reached npm. The provider-specific environment provisioning packages added after 0.79.0 were removed before publishing; they belong to Cotal Cloud.

Full changeset text for 0.80.0, 0.81.0 and 0.81.1

0.80.0

  • Authorized managed Claude launches now accept the selected workspace through the native trust dialog. Startup choices are matched against the current screen and answered once before the existing development-channel confirmation. Foreground trust prompts are unchanged. No tool-permission bypass flag is added; accepting trust enables the checkout's own hooks and settings. Upgrade the connector, core and runtime together; older runtimes do not implement the new startup choices.
  • Add fixed environment-manager guest permission builders and a retained endpoint-gate family marker. These primitives do not yet implement host admission, stock manager bootstrap or hosted agent execution.
  • Add owner-scoped environment provisioning with immutable profiles, persistent creation bindings and verified provider termination. Introduce a Tenki adapter with explicit resource bounds, restricted networking and native secret references. Hosts retain responsibility for workload authority, results and manager enrollment.
  • The channel registry readers now validate each entry the way the write path does. The endpoint's
    registry watch, readChannelConfig, readChannelDefaults and readChannelRegistry decode through
    one decodeChannelEntry, which refuses a value that is not a JSON object or fails
    validateChannelConfig or validateChannelDefaults. A raw put of an unknown delivery class or of
    null on the defaults key is now dropped with a warning, and its channel resolves to the default
    policy, instead of being cached as is. The validators also reject a replay that is not a boolean
    and a description or instructions that is not a string.
  • Validate JSON object members as own properties in the Node compiler. This repairs five of the twenty observed Node conformance cases and adds public-export regressions and named mutation checks. The remaining fifteen cases and browser validation are not resolved by this change.
  • The control target resolver now throws a user-auth mesh's connect refusal when its caller asks for the throwing form, as it already did on a static mesh. It used to print the refusal and exit the process, so on a user-auth mesh with no login on the machine, Ctrl-C on a foreground cotal up --user-auth or a bare cotal down exited 1 from inside the manager stop's agent inventory and left the manager, delivery daemon, user-auth service and broker running. The stop now prints could not list managed agents (<reason>) and finishes the teardown.
  • Managed Claude seats now launch with --permission-mode bypassPermissions by default. A spawned seat has no human at its terminal, so under the default mode its first cotal_dm stopped at a permission prompt nobody could answer and the seat looked dead to its peers. An operator who wants prompts back passes --opt permission-mode=default (or any other mode); the connector adds the default only when the launch options carry neither permission-mode nor dangerously-skip-permissions.
  • A seat never leaves the mesh because its event plane stopped, and the plane comes back on its own. The emitter holder re-establishes the plane at once after any failure, then every second while it stays down, by a fresh start that replaces the emitter: it reopens the write-ahead log, settles any pending frame, and builds the connector's mapper from the run the log has open before reading on. A turn that ends while the plane is down keeps its terminal, as does one whose terminal's own log write failed, and the re-establish closes that run with it once it has read on; every turn that ends during one outage keeps its own terminal, placed on the last turn the source had begun at the position the terminal was reported at (a turn the mapper opens no run for takes its terminal and publishes nothing, and a repeated terminal replaces nothing), a terminal is owed to its run until the frame carrying it freezes, a terminal reported with the plane up goes to the emitter at the hook too so a flush still reading when the next prompt lands closes the turn with its own terminal, and when the next prompt was already written before the plane came back the failure is published in place of the finish that prompt would have synthesized, in a frame of the failed run and ahead of the next run's first. The mapper contract gains { turn: true } for a record that begins a turn and opens no run. DurableSource gains end(), the cursor after the last complete record as of the call, which every connector's source implements; the holder's hooks gain sourceEnd, closeRun returns a promise that resolves once that position is read (the Claude Code hook awaits it before replying), and the emitter takes a ReportedTerminal through queueTerminal, with waitingTerminals, takeOwed, unsettled and seedLastTurn beside it. The wait between attempts is fixed: it neither doubles nor caps, so the plane is back within a second of the fault clearing. The pi adapter's start factory, re-entered by the re-establish, checks the native file instead of reading an acknowledged cursor as a vanished file, and seeds its mapper from the pending frame. A transcript line that is not a record is stepped over and reported on every connector, the jcode journal wrapper included, and one written past the position a terminal was reported at does not hold that terminal: it is placed after the records before it, as is a terminal reported past a record no read answers, such as an OpenCode part still filling when its turn died, which used to hold the turn end reading the session without end; the OpenCode source now reads every record at or before the end reported at a turn end as settled, so that part no longer stops the turns after it from publishing. A terminal reported while the very first start is still waiting on the broker reaches the emitter before its first read, where it used to be queued behind the flush that read past it and close the next turn. On a space that requires events the seat used to exit with code 1 instead; for Claude Code that exit was the "MCP server cotal has disconnected" banner, and Claude Code restarted the server on the next tool call. The eventPlaneStopped sink no longer takes required or stopSeat, the holder's onError receives the delay before the next re-establish (0 for at once) and retryMs is that fixed wait, the Claude and OpenCode mappers take resumeRunId, and a reported unreadable-line reason carries no text from the record itself.
  • A transcript line the harness left unreadable no longer ends the event plane for good. A write cut short by a full disk leaves part of one record glued to the next on a single line; the reader threw on that line and its cursor never passed it, so every restart died at the same byte, and on a space that requires events the Claude Code connector exited with it, which the harness showed as a disconnect. JsonlFileSource now steps over such a line and reports it on the read as a SourceGap with its offset, length and the parser's reason; AguiEmitter.start takes an onUnreadable reporter and refuses to advance over a gap when none was given. The Claude Code connector reports each gap on its stderr and keeps the records after it.
  • cotal models --agent codex now reports a Codex catalog error when the codex app-server child closes its input before model/list is answered. The write to the closed pipe used to fail with an unhandled EPIPE that crashed the manager, so the call timed out and every later request found no manager until it was restarted.
  • Add an internal host-private environment-manager admission index with first-wins coordinate selection and broker-enforced write-once bindings. Require native message-deletion and purge protection, and refuse republishing of private metadata. This does not verify provider confirmation, expose an admission API or issue bootstrap credentials.
  • Add an internal one-shot environment bootstrap issuer that binds its fixed-profile JWT to the native credential ledger and both lifecycle and registration fences. Repeated or uncertain signing attempts remain held. This does not expose an admission API, deliver bootstrap files or enable hosted execution.
  • Refuse environment-manager gates on existing manager authority paths, and reserve the ordinary native gate before releasing direct-store preparation credentials. This does not implement environment admission or stock hosted execution.
  • Preserve the initial native manager-gate revision so an aborted environment registration cannot be restored by a same-input reservation replay.
  • Add internal environment-manager registration reservation groundwork with native lifecycle activation, immutable operation staging and family-bound gate freezing. This does not expose an admission API or issue bootstrap credentials.
  • An empty --subscribe, --allow-subscribe or --allow-publish value on cotal spawn, and an empty --allow-subscribe or --allow-publish on cotal mint, is now an empty list. It used to read as an absent flag, so cotal spawn <persona> --subscribe "" launched with the persona's channels and cotal mint <name> --allow-publish "" granted the agent file's post list. Only an absent flag defers to the persona now.
  • cotal spawn -f now records an agent whose launch settles uncertain in the run's ledger and lists it as pending. Such an agent neither joined the mesh nor exited within the readiness window, and the manager keeps managing it. It used to print as a failed launch with no ledger row, so cotal down -f never stopped it. An agent that exits on launch is still a failure with no ledger row.
  • Stop the spawned nats-server when cotal up cannot write .cotal/nats.pid, in both the foreground and the detached launch. up now exits with the write error and no broker left running, and leaves whatever is at the pid path in place.
  • Preserve delivery credentials when a required whole-stack shutdown stop fails. Remove them only after all required stops succeed, without changing selective delivery teardown.
  • Complete an authorized relative sleep when its duration elapses before the first checkpoint mint. Preserve cancellation, existing-pause replay and checkpoint expiry rules.

0.81.0

  • A manager restart whose activation lands in the same second as an earlier goal-writer or session-ledger issuance no longer fails with conflict and FOREIGN content on its epcred.manager.<instanceId> row. Those two credentials now carry a random issuance: tag, so every mint signs distinct bytes and gets its own ledger row instead of re-signing the credential the restart barrier just revoked.
  • A Claude Code seat whose run turn passed a permission or input prompt now yields done when the turn ends. The plugin registers PostToolBatch, and when the main agent's batch resolves after the prompt, the connector sets the seat back to working and clears the condition, even while the waiting write is still being published. A subagent's batch leaves the prompt in place, and a batch relayed after Stop, StopFailure or SessionEnd leaves the ended turn's status and condition alone. Before this the turn ended waiting to idle, which is not a turn boundary, so the run step stayed pending until the seat was reaped and presence kept the approval condition while idle.
  • The OpenCode plugin holds a native prompt behind every turn end still settling on its session, not the latest alone, and a prompt already waiting follows each turn end reported while it waits. A turn that ends twice, by its error and by the idle that follows, had its barrier replaced by the later turn end, whose position read could answer first and delete it while the error's read was still pending, so a prompt typed in that window landed ahead of the error's position and the failed turn closed as a finish with its successor carrying the error; a prompt that arrived between the two ends waited on the first barrier alone and went through once that read answered, ahead of the idle's position.
  • The OpenCode 2.x connector refuses a session whose registration requires events, through the same arming decision the other connectors use. It refused only when COTAL_EVENTS was set, so launch material carrying eventsRequired, or COTAL_EVENTS_REQUIRED=1 on the user-mode env fallback, started a session with no event plane on a space that requires one.
  • On OpenCode 2.x, a message that arrives while a turn runs now goes out as the next turn as soon as that turn succeeds, fails or is interrupted. The adapter used to buffer it and wait for an unrelated arrival to wake the seat, so a role request could outlive its ack wait and be handed to another holder of the role. A boot prompt held back by a running turn goes out at the turn end the same way. When a turn ends before OpenCode answers the request that submitted it, the adapter waits for that answer before it submits again, so the boot prompt or a run turn is not sent twice. A failed turn's own batch is not resubmitted at once, so a turn that keeps failing does not loop. A turn-start or turn-end event that the session's durable event log places at or before the end of the last turn is ignored, as is a turn end with no turn running, so a replayed turn does not hold the seat busy, settle the next turn's messages before that turn runs, or resubmit a failed batch. A turn-start or turn-end event without a log position is ignored and logged, since it cannot be told from a replay.
  • cotal actor revoke now reads the delivery daemon's eviction reply through the same check the lifecycle barriers use. It prints verified gone only when the reply names the revoked principal, has well-formed counts, and reports a complete scan with no connection left. A reply for another principal, or one that claims verifiedGone with an incomplete scan or surviving connections, used to print live connections closed now (1 kicked, verified gone); it now prints the INCOMPLETE line with the reason the reply was refused.
  • cotal down --preserve-state now refuses a presence row whose card.id differs from the key it was
    read under, with presence record <subject> is malformed. A participant may write any value under its
    own key, so a forged card.id naming the manager let a live participant pass the unmanaged-endpoints
    check, and one naming a retained seat made the lost-manager finish report that seat as still live.
  • A foreground cotal spawn on a static-auth mesh now retires the agent's broker footprint when it fails after provisioning. A failed provisioner stop, secret write or creds file write used to exit with the agent's DM and DLV durables and its read-ACL row left on the broker, with nothing left to remove them. The spawn now records the agent's identity and creds path before it provisions, and the same retirement that follows a failed launch runs before the error is reported.
  • The manager now keys each spawn acceptance by its caller and goal id, the identity the goal plane stores the goal under. A second caller that submitted a spawn under a goal id another caller had already used was refused as "accepted under a different submission" although its own goal did not exist. Each caller's spawn under that id now gets its own acceptance, and a retry is served the acceptance of the caller that sent it.
  • A manager spawn reads the cotal config once and uses that one value for the delegated-runtime refusal of shared MCP servers, the model policy check and the launch's shared servers and spawn.env allowlist. Before this the launch read the file again after the presence snapshot, the accept hooks and provisioning, so a config edited in that window admitted the seat under the old model policy and launched it with the new file's servers and env names.

0.81.1

  • cotal spawn -f now reports a deploy with a failed agent launch as partial. When any launch fails, the summary opens with ! partial deploy onto "<space>" and names the failed agents, and the command exits 1, as down -f does for a partial teardown. The ledger is still written for the channels and agents this run did create. It used to print ✓ deployed onto "<space>" and exit 0 after the failure line. A launch that settles uncertain is listed as pending and does not change the exit status.
    • @cotal-ai/core@0.81.1
    • @cotal-ai/workspace@0.81.1
  • retireDelegatedAgent now removes the seat's local secret family (actor token, sentinel creds and health file, with their secret-store entries) once the host confirms retired: true, before it frees the name. Before this a delegated seat's retirement reported success and released the name while the family it was enrolled with stayed on the participant. A removal that fails is reported and keeps the name held until a retried retirement intent removes it.
    • @cotal-ai/core@0.81.1
    • @cotal-ai/workspace@0.81.1
    • @cotal-ai/seat@0.81.1

What's Changed

  • test: restore live-name and capability snapshot regression coverage by @davidfarah2003 in #3770
  • fix(claude)!: accept authorized managed workspace trust at startup by @davidfarah2003 in #3769
  • test(claude): separate Cotal restoration state from child snapshots by @davidfarah2003 in #3773
  • feat(environment): add owner-scoped provisioning and Tenki adapter by @davidfarah2003 in #3771
  • fix(core): validate JSON object members as own properties by @davidfarah2003 in #3774
  • test(environment): run broker suites in provisioned CI shards by @davidfarah2003 in #3777
  • fix(runtime): complete relative sleep after pre-mint expiry by @davidfarah2003 in #3778
  • fix(cli): record an uncertain spawn -f launch in the run ledger by @davidfarah2003 in #3748
  • fix(connector-codex): handle catalog stdin failures without crashing the manager by @davidfarah2003 in #3753
  • fix(workspace): throw a user mesh's control refusal when the caller asks for it by @davidfarah2003 in #3754
  • feat(core): add fixed environment manager grant primitives by @davidfarah2003 in #3781
  • fix(auth): isolate environment manager authority from ordinary paths by @davidfarah2003 in #3782
  • test(manager): isolate post-shutdown preflight scenarios by @davidfarah2003 in #3783
  • feat(auth): stage native environment manager registration reservations by @davidfarah2003 in #3784
  • fix(auth): preserve aborted environment registration fences by @davidfarah2003 in #3786
  • feat(auth): bind immutable host environment manager admissions by @davidfarah2003 in #3787
  • feat(auth): bind native environment bootstrap signing fences by @davidfarah2003 in #3789
  • fix(cli): preserve delivery credentials on refused stack shutdown by @davidfarah2003 in #3811
  • test(web): restore console session-write fixture coverage by @davidfarah2003 in #3822
  • test(connector-core): repair transport shutdown fixtures by @davidfarah2003 in #3824
  • test(runtime): repair replied cancellation coverage by @davidfarah2003 in #3825
  • test(runtime): repair spawn mutation label and refusal anchor by @davidfarah2003 in #3826
  • test(core): measure remaining schema cases with direct-engine diagnostics by @davidfarah2003 in #3780
  • fix(ci): retain bounded validator acquisition failure observations by @davidfarah2003 in #3830
  • fix: pass fixed acquisition policies through supported config flags by @davidfarah2003 in #3832
  • fix: refuse external pnpm configuration before acquisition commands by @davidfarah2003 in #3833
  • feat(connector-claude-code): bypass permission prompts on managed seats by default by @davidfarah2003 in #3834
  • fix(cli): stop the spawned broker when up cannot publish its pid by @davidfarah2003 in #3844
  • fix(cli): read an empty list flag as an empty list on spawn and mint by @davidfarah2003 in #3846
  • fix(core): validate channel registry entries on the read side by @davidfarah2003 in #3845
  • fix(connector-core): re-establish a stopped event plane instead of stopping the seat by @davidfarah2003 in #3836
  • fix(connector-claude-code): yield a run turn that passed a permission prompt by @davidfarah2003 in #3851
  • fix(auth): read the revoke's eviction reply through the barriers' check by @davidfarah2003 in #3849
  • fix(cli): retire the static foreground footprint when provisioning fails by @davidfarah2003 in #3860
  • fix(core): give each goal-writer and session-ledger mint distinct bytes by @davidfarah2003 in #3862
  • fix(connector-opencode): hold a native prompt behind every turn end still settling, not the latest by @davidfarah2003 in #3853
  • fix(connector-opencode): refuse a required-events registration on the 2.x adapter by @davidfarah2003 in #3866
  • fix(manager): key the spawn acceptance map by caller and goal id by @davidfarah2003 in #3867
  • fix(cli): refuse a preserve-state presence row whose card.id is not its key by @davidfarah2003 in #3868
  • fix(manager): read the cotal config once per spawn by @davidfarah2003 in #3869
  • fix(connector-opencode): drive pending work when a 2.x turn ends by @davidfarah2003 in #3871
  • revert: move the environment provisioning packages out of the public release group by @davidfarah2003 in #3870
  • fix(manager): shred a delegated seat's secret family at its retirement by @davidfarah2003 in #3874
  • fix(cli): report a partial deploy and exit 1 when a spawn -f launch fails by @davidfarah2003 in #3875

Full Changelog: v0.79.0...v0.81.1