fix(workflows): harden TUI input, stage chat interrupts, and executor options - #961
Conversation
Replace the Ctrl+S-only workflow submit affordance with a visible Run action activated via Enter, keeping text editors free to use Enter for newlines until the action is focused. Route Escape, Tab, and Enter handling through pi-tui key matching so Kitty CSI-u and xterm modifyOtherKeys sequences work outside tmux.
Assistant-model: GPT-5.5
Assistant-model: GPT-5.5
Assistant-model: GPT-5.5
Assistant-model: GPT-5.5
Assistant-model: GPT-5.5
Add todo-tool guidance to the system prompt and render hidden/visible thinking content with the muted foreground color. Assistant-model: GPT-5.5
Split destructive kill from resumable interrupt handling, add prefix and all-runs targeting, and support stage-scoped resume messages. Reject discovered workflows without tracked stages and surface startup diagnostics when workflow resources are skipped. Assistant-model: GPT-5.5
Keep attached stage handles alive while chat is open, mirror the coding-agent interrupt flow for Escape, and reuse shared live-chat working-status rendering for embedded stage sessions. Handle pause/resume races, pending streams, cascade pause ownership, and SDK tool args consistently. Assistant-model: GPT-5.5
Render graph edges, forms, prompt cards, switchers, status lists, and workflow cards with safer ANSI slicing, grapheme-aware editing, and width-clamped rows. Preserve footer and status controls in short viewports and improve paused-state rendering across workflow UI surfaces. Assistant-model: GPT-5.5
Review — fix(workflows): harden picker keys and run controlReviewed the substantive code changes (skipped the Ctrl→CTRL doc churn). Overall this is a solid hardening pass — clean interrupt/kill split, useful type cleanup, and the giant Bugs / correctness1. const stage = run?.stages.find(
(s) => s.id === target || s.id.startsWith(target) || s.name === target,
);
2. The new handler only calls 3. Duplicated manifest parsing — Both files independently define Code quality4. function formatHintLabel(description: string): string {
return description;
}Either it's an unfinished stub for description normalization (paired with the new 5.
6.
7. Using Test coverageThe new Positives
Performance & securityNothing notable on perf (the per-render Nothing here is a blocker IMO; #1, #2, and #3 are the items I'd most want addressed before merging. |
Assistant-model: GPT-5.5
Code Review — PR #961Solid, large-scoped PR. The Correctness / potential bugs
const source = Function.prototype.toString.call(run);
return /\.\s*(?:stage|task|chain|parallel)\s*\(/.test(source);This will reject perfectly valid workflows that don't use a literal
Consider downgrading this to a discovery-time warning diagnostic, or moving the empty-graph check to be evaluated after the run executes (where you actually have ground truth). The current rejection message says "graph is empty (cachedLayout.length === 0)" — that condition can be detected post-run without a regex on user source.
if (reason === "quit") {
killAllRuns({ ... });
}This silently does nothing for any other UX nits in user-facing stringsIn
Pick one style. The middot-separated key-action list ( Dead / inconsistent code
Same file: Type tightening — downstream impact
The bivariance hack on Package-manager / config
Resource loader filterIn const workflowResources = [
...cliEnabledWorkflowResources,
...enabledWorkflowResources,
...builtinEnabledWorkflowResources,
].filter((resource) => resource.metadata.origin === \"package\");The filter drops everything that isn't TestsCoverage looks good across the new surfaces (executor output options, stage-chat resumes, workflow runner direct modes, workflow-list/run-detail/status-list renders, store-widget installer). One small gap: I don't see a direct test for the new Overall the structural moves are good and the test investment is real. The biggest risks I'd want addressed before merge are (1) the regex validator's false-negatives and (2) the silent 🤖 Generated with Claude Code |
Assistant-model: GPT-5.5
Code Review — PR #961I focused on the workflow extension, package-manager wiring, the TUI input/stage-chat paths, and the type tightening. Findings are grouped by severity; line numbers reference the diff hunks at the head of each file. Bugs / correctness
Smells / maintainability
Nits
Type tightening — positive notesThe Test coverage37 test files touched, including new coverage for the new surfaces (workflow-runner, workflow-schema, stage-chat-view, run-detail, session-confirm, status-list, store-widget-installer, workflow-attach-pane, workflow-list-render, inputs-picker). Coverage looks proportional to the change. Two gaps worth considering:
Overall this is a well-structured refactor and the type tightening is great. The blockers I'd want resolved before merging are #1 (shutdown leak), #2 (the silent tool-list fix should be CHANGELOG'd), and #4 (mutual-exclusion in |
fix(workflows): harden TUI input, stage chat interrupts, and executor options
Summary
Hardens workflow TUI input handling and run-control semantics across picker shortcuts, stage chat interrupt/resume, and executor execution modes. Also expands workflow runner to support direct task/chain/parallel runs and adds package-level workflow resource discovery.
Changes
TUI / Picker
ctrl+srun shortcut with terminal-safectrl+enterin the inputs picker and updates all shortcut hint labelsStage Chat Interrupt & Resume
handle.resume(text))handle.prompt(text)); Escape interrupts active post-stage responses without mutating workflow dependenciesinterruptsemantics from destructivekillbehavior for workflow run controlExecutor & Workflow Runner
ctx.chain,ctx.task, andctx.parallelto forward output options (output,outputMode,reads,worktree,maxOutput,artifacts) and file-based artifact handlingchainDiras a shared artifact directory for relative reads and outputs in chain runsconcurrencyandfailFastcontrols to parallel execution modesWorkflowDefinitionwith directtask/tasks/chainmodes, so callers can invoke named workflows or ad-hoc task definitions through a single unified interfaceconcurrencyfromWorkflowDefinitioninto executor configPackage & Discovery
workflowsas a first-class resource type in the package manager (auto-discovery, manifest parsing, file-pattern matching for.ts/.js/.mjs/.cjs)pikey for backwards compatibilitygetWorkflowResources()on the extension API; passes resolved workflow resources through the extension loader chainExtension Typings (coding-agent)
getFooterDataProvider()toExtensionUIContextso embedded extension UIs can reuse the core footermodeltype fromModel<any>toModel<Api>onExtensionContextToolRenderContextandToolDefinitiongenerics fromanytounknown; applies bivariance hack to render function signatures to preserve assignabilityprogressfield fromWorkflowTaskSessionFieldsandWorkflowDirectOptionsTests & Docs
Notes
interruptnow represents resumable pause semantics; destructive removal is handled bykill.packages/workflowsships raw TypeScript — no build step introduced.