Add shared live run graphs, debugging, editor choice and draft cleanup

This commit is contained in:
2026-10-09 19:17:43 +01:00
parent 9b8afc874f
commit 0f80ff4e95
33 changed files with 1162 additions and 72 deletions
+52
View File
@@ -116,6 +116,58 @@ Retry replays the entire workflow; earlier edits or notifications are not undone
and may happen again. A missing original directory blocks retry rather than
silently using your current directory.
Retry is hidden and rejected while a run is executing or agent cleanup remains
active, even if a terminal status was already persisted. Run RPCs report
`executing` alongside status so clients can distinguish cleanup from completion.
The run inspector's upper half shows the actual execution path using the shared
pipeline graph renderer and viewport. Visits are numbered, including repeated
visits in loops; only recorded routing decisions become edges. No unchosen stage
is added to the run path. On small terminals the details take precedence. Press
`g` to focus the graph, arrows to pan, and `j/k` or PgUp/PgDn to scroll. Press `g`
or Tab to return to details. When not focused, the graph follows the latest visit
or selected stage. Existing polling refreshes the graph once per second, and
running durations show elapsed time rather than “in progress.”
Press `a` to select the active/latest retained OpenCode agent session and open its
tool evidence. Session ID is available during execution; tool transcripts appear
when persisted (currently after generation). This does not attach a live OpenCode
client or stream its messages. Supporting live attachment consistently across the
shared and privately owned OpenCode backends is deliberately deferred.
## Investigating runs in OpenCode
On the runs list or inspector, press `D` or use `:debug`; CLI equivalent:
`pipelines debug <run-id>`. This opens a fresh normal OpenCode conversation, not
the implementing session. It supplies exact commands for `inspect <run-id>
--json` (including stage history, inputs/outputs, diagnostics, notifications,
session IDs and transcripts), `show <pipeline-id> --version N --json`, and
`runs --pipeline <pipeline-id> --json`. All retrieval remains available through
the CLI and can be repeated while execution is active. No new model API or
live attachment integration is required.
`debug --json` returns the context and prompt without launching OpenCode;
`--no-open` prints the prompt. `--opencode` selects the executable. Debugging
works for active and terminal runs and does not automatically retry, cancel,
or resume them. If the recorded directory is unavailable, OpenCode launches
from your current directory and retrieves historical evidence through the CLI.
## Editor choice and draft cleanup
On the pipeline detail page, `e` / `:edit` opens an editor picker: **nvim** or
**OpenCode**. Type to fuzzy-search; Tab/Shift+Tab (or arrows) choose; Enter opens;
Esc cancels without creating a draft. Explicit choice overrides VISUAL/EDITOR.
Both choices edit a retained copy with the normal version guard, never the
published definition. Submission remains separate and explicit.
In the draft browser, `x` asks to delete the selected draft; `y` confirms and
Esc or `n` keeps it. The CLI equivalent, `pipelines draft-delete <draft.md>`, is
an explicit deletion command and needs no server connection; `--json` reports
the result. Only managed drafts inside the configured draft cache are accepted.
Source and metadata symlinks/directories and external Markdown files are
rejected. Published definitions and run history are not deleted. Cleanup can
also remove orphaned metadata when a draft source was already removed.
```sh
cd ~/repos/project
pipelines run "bug fix" "Fix the layout" --json
+12 -1
View File
@@ -64,4 +64,15 @@ flags, file lists, or typed confirmation, in the invocation directory rather tha
the server directory. Permission regression tests cover language-neutral shell,
project file types/new files, optional narrower scopes, and outside-edit denials.
Real model/tool-permission enforcement remains **not tested**. Shell uses the host
user's authority; these policies are not an OS sandbox.
user’s authority; these policies are not an OS sandbox.
A compiled-binary PTY integration check exercised the fuzzy editor picker in
standalone `pipelines-tui`, choosing both OpenCode and nvim with an intentionally
invalid EDITOR override. It checked confirmed TUI draft deletion, CLI deletion
without touching run history, the shared run graph, and `D` launching a fresh
debugging conversation containing authoritative CLI queries. Mock OpenCode/nvim
processes recorded the actual arguments and directory. Real model-driven run
investigation and live OpenCode UI attachment remain **not tested**.
Focused tests cover elapsed duration, live graph updates via run responses,
shared-renderer equivalence, loop visits, viewport resizing, and retry rejection
during execution cleanup even after a terminal status is persisted.