Skip to content

[2/7] feat: coordinate subagents with tasks, reviews and budgets - #132

Closed
BIackFIame wants to merge 26 commits into
howdeploy:mainfrom
BIackFIame:backlog/1-orchestration
Closed

BIackFIame wants to merge 26 commits into
howdeploy:mainfrom
BIackFIame:backlog/1-orchestration

Conversation

@BIackFIame

@BIackFIame BIackFIame commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part 2/7 of the CanvasTTY agent-workflow series. Reusable task templates, dependencies, a shared board, reviewer results, task budgets and explicit retry make multi-agent work visible and controllable. Selected accounts propagate to children; first prompts wait for CLI readiness, and OpenCode waits return before the client deadline.

Review scope and dependencies

Depends on: #131.

This is a cumulative upstream PR: GitHub's Files changed tab includes earlier unmerged parts because all PRs target upstream main; cross-fork stacked bases are unsupported. Review this part in the predecessor-to-head diff. This comparison also contains the integration of upstream main 6faadcdc. The intended merge order follows the numbered series; do not merge a later part independently of its predecessors.

Accounts account-support changes are a companion.

Validation and limitations

Tested head: b09cfcae5793b97b642519fc090318eb664dde06. Local helpers, typecheck, build and secret audit passed; full suite: 1,931 passed, 6 skipped, zero failures. The six skips cover optional native sandbox, platform-specific and Ollama checks. GitHub CI is pending on this head.

Upstream main 6faadcdc is merged into this branch. The WorkspaceCanvas conflict is resolved with both orchestration and upstream material/terminal-link behavior retained. This remains a Draft while the requested review cycles and current-head CI complete.

Workflow launches require a nonblank user task. Automatic worker review now requires a clean separate worktree with an attributable launch baseline. Shared, initially dirty, unverifiable and submodule-containing trees return an explicit unavailable result, as does a competing managed launch in the same tree. Prepared reviewer account resources are cleaned up on launch failure or cancellation.

A prior real OpenCode/GLM run started three children without prompt resends and completed repeated bounded waits around a long-running child. All failure/retry variants and the full template/reviewer workflow remain separate live acceptance work. This update used real temporary Git repositories and fake provider processes; it did not rerun paid provider, real SSH or Ollama tests.

Series order

  1. macOS clipboard
  2. Orchestration, reviews and budgets — Draft
  3. Worktrees and checkpoints — Draft
  4. Timeline, usage and attention — Draft
  5. Network policies and temporary secrets — Draft
  6. Workspace context and navigation — Draft
  7. Experimental routing, handoff and remote controls — Draft

Parts 2–7 are cumulative Draft PRs against upstream main, with an isolated layer diff in each description. Part 2 now includes upstream main 6faadcdc; parts 3–7 still need that integration and fresh checks before readiness. Part 7 also retains its independent experimental acceptance gate.

@BIackFIame

Copy link
Copy Markdown
Contributor Author

@codex review

Please review this PR for correctness, regressions and security issues. Review only; post findings on GitHub without changing code.

This is part 2/7 of a cumulative series. Focus on changes introduced after predecessor 22620f37238d4693c064216a5ba61fbc5fe7251d through current head 72accd26e8451e187de4436b7d51a4b22a6a1eaf, including their interactions with the inherited code. The isolated layer diff is linked in the PR description. Known merge conflicts with newer main are already documented; look for substantive code defects in addition to those integration blockers.

@howdeploy

Copy link
Copy Markdown
Owner

@BIackFIame, we are rejecting this PR in its current form and closing it after this feedback. This is a product, design and integration decision following local Linux acceptance. The current implementation adds too much harness configuration to the normal CanvasTTY experience and does not meet our UI contract.

The related feedback on #137 is here: #137 (comment). That PR is also being rejected and closed. Please treat a future plugin implementation or an agreed advanced-settings proposal as a new, separately scoped contribution.

1. The design is broken in the Linux acceptance flow

During acceptance on the maintainer's Linux machine, parts of the added UI were unreadable or did not appear correctly, and parts remained in English with Russian selected. The workflow selector shown in the launch card is a concrete example. These observations concern the local combined DEV build; they do not establish that every Linux environment behaves identically.

There is a specific contrast problem in the source: the launch dialog uses var(--text-dark) on its sage surface, while .launch-flow-picker__row select sets a dark #30323f background and inherits the text color. That combination can make the selected value effectively unreadable. It also illustrates why adding independent control styling outside the existing component and token rules is fragile.

The refresh control uses the literal ↻ character instead of our vendored Lucide assets through UiIcon. The new picker has its own border, padding, colors and form grammar. This needs a redesign within the application's existing components, not another independently styled form inserted into the launch card.

Please follow docs/UI_CONTRACT.md: preserve the concise provider launch flow, existing control patterns, shared palette roles and UI scale, and keep advanced explanations out of the default launch surface. Cross-platform readability and complete localization are part of that requirement.

2. Workflow templates are exposed before users can understand them

The picker presents a template name and an expected subagent count. It does not explain the template's purpose, when to choose it, the work it will perform, or how it relates to the existing Agent/Orchestrator choice and permission profiles. Choosing a template also switches the launch role to Orchestrator and disables the Agent choice, which is a significant behavior change that needs explanation before selection.

The backend already provides a description for each template, but AgentLaunchDialog does not display it in this flow. Built-in names such as "Executor and reviewer" and "Three options and a judge" are supplied as English strings and rendered directly through flow.name. Built-in labels and descriptions need proper localization. User-authored template content can retain the author's chosen language, but it must be clearly distinguished from application-owned text.

There is repository documentation about .canvastty/flows/*.yaml; that does not make the feature discoverable or understandable in the application. Users should not have to inspect source files or guess the format to understand an option appearing in their launch card. A future implementation needs an accessible explanation, a concrete example, clear template provenance, and a preview of the resulting roles/tasks before anything starts.

3. Another menu makes the existing permission and environment choices harder to understand

CanvasTTY already has agent permission profiles, sandbox/environment choices, and understandable enable/disable controls. Contributions from other authors also improve those existing paths. The new workflow picker adds a further configuration axis to the same launch surface, while the surrounding series adds more policy, goal, review and budget controls.

Technically, a workflow template describes task choreography; it does not itself change the caller's permissions. That distinction should be visible to the user. The current composition makes users work out the relationship between a workflow, an orchestrator role, a permission mode, an environment and the later execution-policy controls. A new dropdown without a clear hierarchy increases uncertainty about which option actually governs execution and safety.

We are preserving the application's minimal default workflow. More configuration is justified only by a clear user need, with a coherent place in the existing UI and explicit opt-in. Successful helper tests or a mergeable branch do not establish product acceptance or a usable Linux interface.

4. Acceptable direction for future work

Please take this harness/orchestration configuration into a separately installed CanvasTTY plugin. The plugin can own its templates, task board, review configuration, budgets and related UI, using the existing supervised services, launch contributions, environment and session APIs described in docs/ARCHITECTURE.md.

If an operation cannot be implemented through those capabilities, propose a small plugin-system extension first. Explain the concrete missing operation, its contract, permissions, ownership, cancellation and behavior when the plugin is disabled or unavailable. Core must continue to validate privileged operations and enforce its trust boundaries; a plugin should not acquire authority through a template or recommendation.

An alternative we can discuss is integration into the existing settings as an explicitly enabled Advanced mode. That would require an agreed design before implementation: reuse existing controls, consolidate related configuration, preserve simple defaults, explain precedence, and provide a clear way to return to normal behavior. The warning must describe actual consequences, such as starting additional agents, consuming additional tokens or changing task execution. It must not imply that enabling advanced mode grants permission to bypass host validation or weaken safety silently.

For either direction, the acceptance criteria are:

  • Existing launch and safety controls retain a clear, consistent meaning without the optional feature.
  • Built-in labels, descriptions and actionable states are localized; controls are readable on Linux in the existing palettes and UI scales.
  • Templates have discoverable explanations and a concrete preview of what will run.
  • Advanced harness configuration is deliberately enabled and lives in a coherent optional surface.
  • Any required core API changes are separated from the plugin's policy and UI implementation.

The current series is cumulative. Closing #132 and #137 does not approve their code through another PR that includes them. Please split or rebase the remaining proposals so independently useful changes can be reviewed without bringing the rejected harness configuration back indirectly.

This PR is rejected in its current scope. Please use the direction above for a future proposal rather than continuing to expand this core launch/configuration interface.

@howdeploy howdeploy closed this Oct 12, 2026
howdeploy added a commit that referenced this pull request Oct 12, 2026
This integrates the six contributions accepted during the maintainer's DEV review, together with the maintainer's local UI and minimap fixes. Rejected orchestration features, including #133, are excluded entirely.

## Included contributions and credit

- #125 by @tab11pm: read-only file cards, directory browsing, and richer Markdown/code previews.
- #130 by @SaneSanders: image/material remarks and handoff to an existing agent session.
- #131 by @BIackFIame: macOS clipboard/edit context menus for text fields.
- #138 by @pepechka-kun: usage history, measured quota changes, local-log evidence, and explicit attribution uncertainty.
- #139 by @CLOSETTTY: interactive mascots and the Codex mascot creation workflow.
- #140 by @teo-nex: the macOS node-pty file-descriptor leak fix, patch delivery, and resource diagnostics.

Thank you to all six contributors. Each original PR head and its author commits are retained in Git history through separate merge commits. This integration must use a merge commit rather than squash or rebase.

## Maintainer patches

- Fit the minimap overview to the camera viewport and all canvas objects together, with padding; retain stable drag coordinates during a gesture.
- Keep the material handoff icon fixed in the header, remove the count beneath it, and place equally sized Cancel/Send actions at the bottom right of the handoff dialog.
- Split usage history into five left-side sections: conditional estimate, quotas, agents, local-log tokens, and source state. Use pages within sections to fit the window without a long scrolling report.
- Resolve shared App/IPC/preload integrations while retaining the file, handoff, and usage-history flows.
- Retain the approved DEV dependency set and Electron 43.7.7; reuse the matching lockfile with patch-package 8.0.1.

## Scope

#132, #133, #134, #135, and #137 are not included. #136 is also excluded pending the previously requested UI/UX redesign. No commits from that cumulative orchestration series are ancestors of this branch.

Material handoff in #130 does not automatically apply a saved JSON agent report to the material state; this remains the reviewed behavior.

## Validation

- `VITE_BUILD_CHANNEL=DEV npm run build` passed, including the script's TypeScript checks and native-helper build.
- `git diff --check` passed.
- Verified that all six accepted PR heads are ancestors of the integration and all six excluded PR heads are not.
- Verified that the three approved local UI/minimap implementations match the selected DEV copy.
- Added minimap geometry coverage for distant camera positions and adapted usage-history fixtures for section navigation.
- The maintainer manually reviewed the accepted features in the earlier combined DEV build. The final integration without #133 has not received another manual UI pass. Automated tests and macOS/Windows runtime checks were not run locally for this integration.
howdeploy added a commit that referenced this pull request Oct 12, 2026
Prepare CanvasTTY 1.8.0 from the approved main integration, preserving all contributor history and the maintainer's UI/minimap patches.

- Bump package and lockfile versions together and document the user-visible changes in all three changelogs.
- Fix the release-blocking Hermes read path: use an immutable read before opening a stopped WAL database without side files, so collection does not create a WAL file in the source directory. The existing live/stopped/orphaned WAL regression covers this behavior.
- Refuse symlinked or replaced usage-history paths before reading on Windows as well as Unix; retain the existing symlink regression.
- Adapt Windows Codex fixture launches to the existing batch-launch path, restrict chmod-specific assertions to platforms that implement Unix permissions, and update the history overlay assertion for the merged material dialog guard. Cross-platform accounting and symlink checks remain enabled.

Validation: `git diff --check`, matching manifest/lockfile versions, and a clean local Linux AppImage/DEB build passed. The Linux update manifest matches both artifacts' sizes and SHA-512 hashes. CI tests passed on Linux and Windows; Windows and macOS package checks, both mascot-pipeline jobs, and the macOS PTY job passed. A subsequent Linux packaging step failed with HTTP 504 after the application build; that single job is being rerun. The tagged release workflow repeats the required release checks, builds native installers for all three platforms, and verifies the complete signed update artifact set before publishing. No local UI check or real-device update test has been run.

Release notes credit @tab11pm, @SaneSanders, @BIackFIame, @pepechka-kun, @CLOSETTTY, @teo-nex, @Yt4aZaveta, and @theorangecolorv2. The orchestration additions in #132–137 remain excluded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants