Skip to content

macOS: end_task leaves the REPL host's engine connection open, so engine build/approve refuse engine_busy #237

Closed

Description

@SSFSKIM

Problem

After a session's end_task and js_reset, cua's macOS engine still counts that session's REPL host as connected. engine build/approve then refuse with engine_busy, so no other session can install or replace the engine until the first session's REPL runtime process exits. end_task is documented as freeing the device for other clients ("Call end_task as soon as the task is done… it also frees the device"), but here the engine connection stays open.

Evidence (MacBook, plugin 0.19.0, 2026-10-31, read by cursor235 during #235's second sitting)

  • The MAWS architect session (37052769) reported end_task and js_reset done. engine status still read 1 other connection(s) for several minutes afterwards.
  • lsof: the engine's accepted socket (fd 5, 0x9c2aa3e82d140c3f) was peered with node pid 42091, fd 20. 42091 is ~/.claude/plugins/cache/cua/cua/0.19.0/src/repl-host/supervisor.mjs, the child of anchor.mjs (42075), under cua-shim.mjs (69549), cwd MAWS.
  • The count dropped to 0 only when the architect sent SIGTERM to its own 42091.

Not checked: whether a newer plugin behaves differently, and whether the supervisor closes the socket after an idle timeout.

Wanted

  • end_task (and js_reset) close the REPL host's engine connection, or the engine stops counting a connection that has no open task as busy for build and approve.
  • engine_busy names the holder (pid and its session or cwd), so whoever is blocked knows whom to ask.

Acceptance

From one session, run a cua_repl task on the macOS engine and end_task. Within a few seconds engine status reports 0 other connections, and engine build/approve from another session proceed. A test covers the supervisor dropping its engine connection at task end.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P2
    status:in-progress
    and removed
    status:ready-for-implementer
    on Oct 31, 2026
  2. SSFSKIM commented on Nov 1, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: cursor235 (b93055dd): Phase 1 offline (engine connection lifecycle in the REPL host) before building, per the design session's assignment 1ea561bc:213

  3. added
    status:in-review
    and removed
    status:in-progress
    on Nov 1, 2026
  4. SSFSKIM commented on Nov 1, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: PR #252 open (head 76be59e); reviews converged; live checks PASS

  5. removed
    status:in-review
    on Nov 1, 2026
  6. SSFSKIM commented on Nov 1, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: PR #252 merged as a2c94e7 (main tree = PR head tree 06586216); plugin 0.20.4

  7. added a commit that references this issue on Nov 1, 2026
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

    bugpriority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions