Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ steps, project setup, headless operation, and removal.
| [docs/architecture.md](docs/architecture.md) | Component responsibilities, a short issue-to-PR overview, configuration ownership, scheduler ownership, and shared state. | Start here to understand how the system is divided before locating implementation code. |
| [docs/bot-workflow.md](docs/bot-workflow.md) | Eight Mermaid diagrams and detailed implementation notes: startup and polling; discovery and routing; task phases; sessions and questions; media helpers; verification and publication; feedback, merging, and tab closure; status, retries, and recovery. Includes links to the source for each area. | Use for exact execution order, state transitions, checkpoint behavior, failure paths, and tracing a bot task from issue to merged PR. |
| [docs/configuration.md](docs/configuration.md) | The standard `.opencode/automation.json` format, defaults, setup flags, configuration tracking across Git branches, authors, triggers, checks, base branches, model capabilities, media helpers, custom prompts, signatures, and auto-merge settings. | Use when adding or changing user-facing configuration, defaults, or setup examples. |
| [docs/runtime.md](docs/runtime.md) | User-visible behavior while the bot runs: GitHub questions and permission replies, branch selection, media inputs, prompt loading, follow-up comments, session tabs, runtime sidebar/status freshness, and routine management commands. | Use when changing issue conversations, session continuation, runtime tools, or TUI behavior. |
| [docs/runtime.md](docs/runtime.md) | User-visible behavior while the bot runs: GitHub questions and permission replies, branch selection, media inputs, prompt loading, follow-up comments, session tabs, runtime sidebar/status freshness, local task closure, and routine management commands. | Use when changing issue conversations, session continuation, runtime tools, or TUI behavior. |
| [docs/advanced.md](docs/advanced.md) | Separate scheduler/dispatcher setup, multiple repositories, custom RPC jobs, full options, timeouts, management and retry commands, persistence, reconciliation, locks, and known limits. | Use for low-level configuration, operational troubleshooting, recovery, or ownership/concurrency changes. |
| [docs/installation.md](docs/installation.md) | Loader registration, config-directory precedence, prerequisites, source installation, project-local installation, upgrade conflicts, testing on another machine, and migration limits. | Use when working on packaging, installers, registration, upgrades, or deployment troubleshooting. |
| [docs/releases.md](docs/releases.md) | Feature-to-devel and devel-to-release PR checks, automatic patch versions, manual npm version/tag releases, exact changelog notes, publication recovery, README commits on release, automatic release-to-devel synchronization, and promotion PRs into protected main. | Use for CI triggers, versioning, packaging, GitHub Release publication, branch permissions, or recovery after a failed release. |
Expand Down Expand Up @@ -58,7 +58,7 @@ the installation block without making remote writes. Keep its markers intact.
and GitHub plugin entrypoints. `src/easy.ts` resolves standard project settings;
`src/config.ts` defines the configuration schemas and route matching.
- `src/dispatcher.ts` owns discovery, the durable task lifecycle, questions,
feedback rounds, publication coordination, retries, and merge polling.
feedback rounds, publication coordination, retries, durable task closure, and merge polling.
`src/scheduler.ts` owns interval jobs; `src/state.ts` owns persistence and locks.
- `src/executor.ts` owns analysis, base selection, worktrees, session execution,
verification, and pushing. `src/analysis.ts` and `src/branch.ts` validate model
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ include the full version, for example `## 0.7.0-beta.1`.

### Added

- Manage tasks directly from `/bot`: inspect details, open sessions, close idle
tabs, restart workflows, or stop sessions and durably end tracking without
deleting work. Preserve closed tasks as history and skip rediscovery, feedback,
runtime hooks and publication after closure, including missing issue/PR cases.
- Identify blocked, failed and closing issue keys and errors in the runtime
sidebar instead of showing only an anonymous attention counter.

- Add a live BOT RUNTIME sidebar and `/botstatus` report with dispatcher operations,
scheduler scans/retries, queue counts and selected-task details. Keep stale and
unavailable readings explicit; monitor through read-only owner-scoped RPC.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ installations are not removed by `npm uninstall --global`.
`/botstatus` opens a full text report. Status refreshes every five seconds;
unavailable or stale readings are marked explicitly. See
[runtime panel details](docs/runtime.md#runtime-status-sidebar).
- **Task management:** `/bot` lets you open a session, inspect details, close idle
tabs, restart a stopped workflow, or stop sessions and end task tracking. Closing
tracking preserves all local work and history, works without a surviving GitHub
issue/PR, and prevents rediscovery. See [task management](docs/runtime.md#manage-tasks-from-bot).
- **Progress:** use `/bot` in the TUI, or the CLI's `status`, `scan`, `pause`, and
`resume` commands from the target repository. Closing a PR closes its bot tabs
while retaining session history. Authorized issue comments can continue work
Expand Down
25 changes: 25 additions & 0 deletions docs/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,28 @@ API references: [OpenCode 2 plugins](https://opencode.ai/v2/docs/build/plugins),
[GitHub issues](https://docs.github.com/en/rest/issues/issues),
[comments](https://docs.github.com/en/rest/issues/comments),
and [pull requests](https://docs.github.com/en/rest/pulls/pulls).

## Ending task tracking

Use `/bot` → select issue → **Stop and close task**. The owner-scoped RPC is
`automation.github.close` with `{ "key": "owner/repository#123" }`, returning
`{ "accepted": true }` when durable closure is queued or `false` if already closed.
There is no corresponding setup CLI subcommand. This action does not require the
GitHub issue/PR or saved session to still exist. It never deletes local work.

The queue retains phase and history with statuses `closing` and `closed`,
`closeRequestedAt`, `closedAt`, and `closeError`. Interruption of all saved main,
earlier-round and media session IDs is bounded to 15 seconds per request; missing
sessions are ignored, other failures retry no sooner than 30 seconds. Closure
waits for the selected task's in-flight worker and question posts, then interrupts
again to cover a session creation that was already in flight. Checkpoint guards
prevent late results from publishing or reviving the task. Publication/merge
already in flight rejects admission, rather than promising to undo remote effects.

Pending closure is resumed on startup. Keep the queue and Git worktree backups
when upgrading: older plugin builds do not understand these two new statuses.
See [runtime management](runtime.md#manage-tasks-from-bot) for the UI and limits.

While a closure is pending, the dispatcher does not start another worker pass.
An unrelated already-running task can finish; scanning continues for other tasks.
The monitor reports task maintenance until closure completes.
7 changes: 7 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,10 @@ activity snapshots. Scheduler status retains its existing RPC. The TUI polls bot
independently every five seconds through the connected client; it does not infer
worker activity from queue status alone. These live diagnostics do not add durable
workflow phases or replace the existing ownership keepalive.

Operator task closure is a durable dispatcher operation: `/bot` sends the owner
`automation.github.close`, which records `closing` before interruption and later
`closed`. Closed records remain as history and prevent rediscovery; scans, runtime
hooks, feedback execution and merge monitoring exclude them. Session/worktree
data is retained. See [task management](runtime.md#manage-tasks-from-bot) for
in-flight operation limits and the distinction from closing a TUI tab.
Loading