Skip to content
This repository was archived by the owner on May 23, 2026. It is now read-only.
This repository was archived by the owner on May 23, 2026. It is now read-only.

oca maintain execute self-blocks when run from OpenCode #11

Description

@JRedeker

Problem

oca maintain --execute hard-refuses when any opencode process is active. When invoked from inside an OpenCode session, the caller's own OpenCode process is included in the active-process blockers, so execute mode self-blocks.

Observed after running:

go run ./cmd/oca maintain --execute --project /home/jrede/dev/opencodeadvance --include-merge=false --include-rebuild=false
go run ./cmd/oca maintain --execute --project /home/jrede/dev/oc-plugins/advance --include-merge=false --include-rebuild=false

Both reported ACTIVE_OPENCODE_PROCESS blockers even after other sessions were closed. Likely remaining blockers were the current OpenCode session itself.

Desired improvement

Make the diagnostic and/or execution model clearer for maintainers:

  • Identify when blockers include the caller's own OpenCode session/process.
  • Surface a clearer message: e.g. "execute must be run from outside OpenCode after closing sessions".
  • Consider a safe self-exclusion path only if oca maintain is invoked by a standalone non-OpenCode CLI process and can prove the detected PID is not a live ADV worker/session for the target project.

Constraints

  • Keep the conservative default: never mutate while live OpenCode/ADV/Temporal workers may be using the project.
  • Do not add auto-kill or hot reload.
  • Avoid weakening the hard active-session gate added for offline maintenance.

Acceptance criteria

  • oca maintain --execute output distinguishes external active sessions from caller/self process blockers.
  • Running from inside OpenCode gives actionable guidance to rerun from an external shell.
  • Tests cover the self-block diagnostic path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:mediumMedium priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions