refactor: define canvas UI as an SDK client tool (#1797)

* refactor: define canvas UI as an SDK client tool

Send a JSON-defined canvas_ui_client tool on new, profile-based, and resumed conversation requests while retaining the legacy Python registration for persisted conversations. Normalize the new SDK event kinds to the existing Canvas UI rendering.

Co-authored-by: smolpaws <engel@enyst.org>

Co-authored-by: openhands <openhands@all-hands.dev>

* fix: omit canvas client tool from ACP launches

* refactor: rename canvas client tool

Use the semantic canvas_ui_control name and contain the SDK-generated action discriminator behind exported constants.

Co-authored-by: Engel Nyst <engel.nyst@gmail.com>

---------

Co-authored-by: Engel Nyst <engel.nyst@gmail.com>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Debug Agent <157206163+simonrosenberg@users.noreply.github.com>
This commit is contained in:
🐾 smolpaws
2026-07-15 09:40:57 +00:00
committed by GitHub
co-authored by openhands Engel Nyst Debug Agent
parent d68bbc8d38
commit 2b7ceea667
27 changed files with 466 additions and 154 deletions
+5 -6
View File
@@ -636,10 +636,9 @@ function buildConfigFromPorts(ports, cwd, env) {
env.LOCAL_BACKEND_API_KEY ||
getOrCreatePersistedApiKeyFile(persistedKeyPath);
// Host directory containing Agent-Canvas-specific Python tools (e.g. the
// canvas_ui tool). Added to OH_EXTRA_PYTHON_PATH below so the agent-server
// can import the modules listed in `tool_module_qualnames`. Lives at
// <repo-root>/tools relative to this script.
// Host directory containing the legacy canvas_ui Python module. Persisted
// conversations created before the client_tools migration still reference
// its module qualname, so the agent-server can import it when resuming them.
const canvasToolsDir = fileURLToPath(new URL("../tools", import.meta.url));
return {
@@ -719,8 +718,8 @@ export function buildAgentServerEnv(config) {
// a follow-up change to the automation preset reads
// OH_SESSION_API_KEYS_0 directly (which is already in env).
AGENT_SERVER_URL: config.backendBaseUrl,
// Make the host tools/ directory importable so the agent-server can
// resolve modules listed in tool_module_qualnames (e.g. canvas_ui_tool).
// Let the agent-server resolve canvas_ui_tool when old persisted metadata
// requests that compatibility module during startup.
OH_EXTRA_PYTHON_PATH: config.canvasToolsDir,
};
}