Skip to content

[7/7] feat: gate model routing, handoff and remote controls - #137

Closed
BIackFIame wants to merge 86 commits into
howdeploy:mainfrom
BIackFIame:backlog/6-experimental
Closed

BIackFIame wants to merge 86 commits into
howdeploy:mainfrom
BIackFIame:backlog/6-experimental

Conversation

@BIackFIame

@BIackFIame BIackFIame commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part 7/7 of the CanvasTTY agent-workflow series. The final part adds default-off model/account routing, autonomous or manual task goals, quota handoff, companion controls and remote-session integration. Approved execution targets bind CLI, account/model, environment and data class; authorization is rechecked at launch, restore, handoff and input. Assistant privacy defaults remain at least as strict as the core floor.

Review scope and dependencies

Depends on: #136.

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 isolated predecessor-to-head diff. The intended merge order follows the numbered series; do not merge a later part independently of its predecessors.

Requires the experimental Assistant, Accounts and Environments companions. Assistant contains offline benchmark ratings, weekly refresh, effort-aware comparisons and preview-model decisions. Keep Draft and default-off pending acceptance.

Validation and current blockers

Tested feature head: 65b7bf55cf727e2b46a51559218f43cf907da2f5. Local helpers, typecheck, build and secret audit passed; full suite: 2,127 passed, 12 skipped, zero failures. Historical fork CI passed on macOS, Linux and Windows using the exact candidate tree under a temporary workflow overlay. That overlay is not included here.

Draft: merge preview against updated upstream 6faadcdc found conflicts in src/preload/index.ts, src/renderer/src/features/workspace/WorkspaceCanvas.tsx, src/shared/contracts.ts. These historical results do not validate a conflict-resolved integration with current main. Preserve the newly accepted material/terminal-link behavior, resolve the overlaps, and rerun checks before marking ready.

Historical routing selected the expected model on 18/20 tasks, including two under-routed difficult tasks. A later real OpenCode/GLM run delivered three worker tasks without resends and passed 10/10 independent artifact checks in Suggest mode. Auto qualification and a separate verifier remain required. No quality or cost improvement is established. Latest execution-authority/privacy repairs have local and CI evidence, not a fresh live-provider/SSH run. Quota handoff, phone control and remote reconnect lack complete live acceptance; remote approval is not remote sandbox enforcement.

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. Their tested feature heads currently conflict with newer upstream changes; integration and fresh checks are required before readiness. Part 7 also retains its independent experimental acceptance gate.

@howdeploy

Copy link
Copy Markdown
Owner

@BIackFIame, this needs a product and architecture rework before we can accept it into CanvasTTY core. The routing and harness work should be an explicitly installed, optional plugin. If that plugin needs capabilities the host does not currently expose, please propose narrowly scoped plugin-system changes separately.

The Settings screen from local DEV acceptance makes the problem clear: ordinary agent configuration now starts with an execution-destination policy editor, data classification, account/model binding and terminology about model ratings. This changes the scope and mental model of the application substantially.

1. Rebuild the UI within the existing design contract

The visual implementation needs to be rebuilt using our existing components and design language. A palette adjustment to the current form will not address the underlying composition and interaction problems.

Our UI contract defines concise default Agents settings, compact copy/control rows for simple settings, shared application tokens and the root UI scale. Detailed explanations belong in expandable help. The current ExecutionTargetSettings uses a separate fieldset/legend form and its own grid rules, native selects, inline paragraphs and a large creation form, bypassing the SettingGroup composition used around it.

In particular, SettingsPanel renders this editor unconditionally at the start of the Agents section. The policy being disabled does not hide or progressively disclose the configuration. The experimental routing gate therefore does not keep this complexity out of the default Settings experience.

Please rebuild the user flow using the established spacing, typography, controls, tokens and interaction patterns. Any additional host UI must have an agreed ownership and fit the existing Settings contract. Installing an optional plugin should lead to a clearly identified plugin configuration surface, rather than a new harness-administration form at the top of core Agents settings.

2. The configuration demands too much knowledge before explaining its benefit

The form asks the user to understand D0–D3, a default task class, a maximum destination class, a CLI, an account, a model, an environment and account-route identity. The practical question the user needs answered is much smaller: which agent should run this task, and what will it be allowed to receive?

“Model ratings do not grant access” introduces another system without showing a rating, explaining its source or connecting it to a concrete action. Your description places those ratings in the separate Assistant companion. Core Agents settings should not assume the user has installed that companion or understands its evaluation model.

The consequences also need clearer communication. In TerminalManager, inputChecked revalidates execution authorization for existing agent sessions, with an exception for Ctrl+C. Removing an approved destination can therefore prevent further interactive input to an already running session. The form's explanation about blocking new tasks does not adequately describe that effect.

Please start from a concrete user scenario, explain the resulting action and scope, and reveal advanced configuration only after deliberate opt-in. We do not want ordinary use of the canvas to require configuring a custom agent harness.

3. The coupling creates an ongoing integration burden

GitHub currently reports this head as MERGEABLE/CLEAN. The historical conflict notes in the description need updating. The architectural overlap remains significant even when Git can merge the text automatically.

The #136-to-#137 layer reaches TerminalManager, LaunchPipeline, TerminalSessionStore, SettingsStore, shared contracts, preload/IPC, orchestration tools, companion control and core Settings. Destination policy now participates in creation, prepared-launch validation, restoration, handoff and terminal input. Persistent session records carry authorization/classification state, while core settings store the destination list.

These are central paths that other work also changes: account preparation, terminal restart/restore, worker lifecycle, environment handling and companion input. Each future change must preserve this feature's authorization and privacy state across all of those paths. That is a semantic integration and maintenance cost; successful conflict resolution alone does not establish that those interactions are correct.

The core now also knows policy concepts and route identity associated with Assistant/Accounts/Environments. Disabling an experimental feature flag leaves that code, persisted state and UI ownership in the host. This is too broad a dependency for an optional harness feature.

4. Requested direction

Please split the work into an optional plugin implementation and any genuinely necessary, separately reviewable host API extensions:

  • Put harness-specific configuration, model-rating/routing strategy, task goals and its policy UX in the plugin. Installing and enabling it must be an explicit choice; the normal canvas and Agents settings should retain their existing workflow without it.
  • Start with the existing extension points documented in ARCHITECTURE.md: supervised plugin services, launch contributions, environments, session operations, decision hooks and plugin UI contributions. Map each required operation to an existing capability before proposing a new one.
  • For a missing capability, open a focused core proposal explaining the concrete use case, request/response contract, permission and ownership rules, cancellation/revocation behavior, and behavior when the plugin is disabled or unavailable. A generic routing capability may be useful; adopting the entire harness policy model into core requires a separate product decision.
  • Keep host security enforcement in the trusted main process: validation, permission checks, credential handling, environment ownership and refusal behavior remain host responsibilities. A plugin's model rating or recommendation must never grant itself access. Moving policy and UX into a plugin does not mean moving authoritative security checks into plugin-controlled code.
  • Separate independently useful companion/remote-control changes from this harness work so they can be reviewed and accepted on their own requirements.

Please keep #137 in Draft while this boundary and the revised UI are worked out. For the next iteration, provide the plugin flow, identify the exact host APIs that are missing, and show how the redesigned interface follows the existing CanvasTTY components and contract. That gives us a concrete, smaller integration to review without making harness administration a built-in isolation and management layer of the canvas.

@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.
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