Repository navigation
Conversation
Give opted-in command executions isolated opaque credentials and scoped HTTP/MCP tools without inheriting dashboard or infrastructure privileges. Persist identities across reconnects and revoke them with execution lifecycle changes. Redact workload credentials from output.
Replace the Kubernetes credential registry with ServiceAccount tokens, TokenReview and current execution checks. Keep Docker file credentials. Kubernetes agents using opaque tokens require explicit recreation; no legacy credential fallback is retained.
Snapshot Kubernetes grants on runtime-created Pods and authenticate without loading daemon sessions or execution records. Native Pod lifecycle controls Kubernetes revocation; Docker retains its file-based credential registry and captured grants.
Docker tools deliberately allow anonymous access to every deployment and ignore permission grants. Restrict this runtime to trusted local use. Remove the file registry, token mounts and credential lifecycle machinery. Kubernetes Pod-bound authentication and unrelated route auth stay unchanged.
Restore existing log encoders and remove obsolete opaque-token matching. Keep JWT sanitization at workload log/error output instead of scanning all logs and rescanning every serialized MCP result. Verify HTTP/MCP sanitization parity without changing Kubernetes isolation, Docker tool access or execution tracking.
Delete parallel agent REST routes and their owner-auth fallthrough. Keep existing owner REST endpoints registered once with normal auth; OpenHands continues using the unchanged MCP tools. BREAKING CHANGE: agent tools are available only at /:id/mcp. Kubernetes permissions and anonymous Docker MCP behavior are unchanged.
Updating a stored command definition must not implicitly stop its current execution or discard queue/status state. Pod grants are immutable for the running execution; stop and restart remain explicit operations. MCP create_command continues rejecting existing command names.
Remove recovery-only flags, duplicate queue execution IDs, unused workload environment metadata and the no-op runtime closer. Narrow authenticated identity to deployment binding and permissions; retain Pod ownership checks and execution tracking independently. Authorize a bounded command wait at acceptance, not on every poll. An accepted wait can finish after revocation within 30 seconds; subsequent requests still require current credentials. Cover both behaviors and hydration without legacy recovery flags.
Expose every workload tool through resource REST routes and MCP. Reuse existing queue, run, removal and publication owner handlers. BREAKING CHANGE: remove execution IDs from runtime status and tool payloads. Waiting observes the current command, including later runs. New Kubernetes agents need commands:remove to remove commands.
Provision worker and agent ServiceAccounts together during materialization, not command execution. Keep token metadata and environment injection inside each runtime backend. No migrations, legacy handling or automatic repair.
Use local Auth JWKS so supplied dashboard credentials validate instead of failing under anonymous-only local configuration.
| return err | ||
| } | ||
| callbacks := appservices.NewWorkerCallbackManager() | ||
| if err := supervisor.SetWorkloadAPIURL(runtimeWorkloadAPIURL); err != nil { |
There was a problem hiding this comment.
can we not just add to NewRuntimeSupervisor?
There was a problem hiding this comment.
Addressed in 7a498dc. NewRuntimeSupervisor now accepts and validates the workload API URL before creating the backend. Removed SetWorkloadAPIURL and updated all callers, including integration fixtures. Added constructor tests for URL validation, normalization and configuration being available during backend creation.
| @@ -0,0 +1,198 @@ | |||
| package handlers | |||
There was a problem hiding this comment.
id dont like this file. its splits routes to somewhere else. mcp and http routes should be more distinged. for mcp stuff i want multiple files for different handlers. and a mcp.add function instead. this needs to be solved cleaner!
There was a problem hiding this comment.
Addressed in 7a498dc. Removed command_tools.go and its hidden route-registration function. All REST and MCP routes are now declared directly in routes.go with named REST handlers. MCP has a separate entrypoint and command, console, status, UI and schema files; commandMCP.add registers tools and applies permission-filtered discovery. HTTP and MCP still share the existing operation module, without changing paths, schemas or authorization. Verification: go test ./..., focused handler race tests, integration-tagged compile check, gofmt and diff checks all pass.
Configure the workload API URL during supervisor construction so backend creation cannot observe incomplete configuration.
Share upload-only and build-dependent publication across HTTP and MCP. Keep initialization upload-only and delegate live rebuilds to declared commands. BREAKING CHANGE: UI declarations require wasm/openui instead of path. Publication accepts with_build instead of a path override; no legacy fallback.
Summary
/:id/mcpand normal resource REST routes through the same permission-checked service. No generic tool RPC route or tool-name-dependent owner fallback.commands:remove: stop/remove a command's definition, runtime containers and queue/status. Preserve deployment data. No temporary-command tool.REST mappings
Paths are relative to
/:id/api/v1.Existing queue, run, removal and publication routes are registered once and preserve their original owner-authenticated handlers, responses and status codes. Workload callers use the shared tool service.
Verification
go test -p 1 ./....git diff --checkpassed.Accepted behavior and rollout
commands:removefor removal. No automatic recreation.Related PRs
Backend-owned workload setup