Repository navigation
fix(compose): pin the platform hostname so workspace binds survive recreation - #1158
Open
linus-liu-web wants to merge 1 commit into
Open
linus-liu-web wants to merge 1 commit into
linus-liu-web wants to merge 1 commit into
Conversation
…creation The engine takes the workspace host from os.Hostname() and every run and conversation workspace stores it in runs.workspace_host. A Compose container's default hostname is its container ID, so recreating the platform (an upgrade, ./start.sh pull, or any image or service change) leaves earlier workspaces bound to a host that no longer exists. The engine then treats those workspaces as foreign: approval and control actions reject runner-bound runs, and control-plane workspaces send terminal and Agent browser requests down the API/worker control channel, which fails with a workspace-control configuration error that asks for AGENTFLOW_CONTROL_TOKEN even in the single-container role=all deployment. Pin the hostname on the Compose platform service and document that it must stay stable. Refs Tencent#1079
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
compose.yamldoes not set ahostname:on theplatformservice, so the container hostname is the container ID. The engine takes the workspace host fromos.Hostname()(cmd/agentflow/main.go,internal/engine/engine.go), and every run and conversation workspace stores that value inruns.workspace_host. Recreating the platform container — an upgrade,./start.sh pull, or anydocker compose upafter an image or service change — therefore leaves earlier workspaces bound to a host that no longer exists, andforeignWorkspaceBind(internal/engine/run_recovery.go) treats them as owned by another execution host.Two user-visible failures follow:
浏览器所在执行端不可达:工作区控制通道配置错误…请为 API 和 Worker 配置相同的 AGENTFLOW_CONTROL_TOKENeven in the default single-containerrole=allCompose deployment, where there is no API/worker split andAGENTFLOW_CONTROL_TOKENis not part of the setup.This PR pins
hostname: loopforge-platformon theplatformservice and documents why it must stay stable. Separately deployed workers and execution hosts already report the machine hostname they run on, so they are not affected.Scope
Refs #1079. The runner-bound workspace recovery discussed there is a separate change; this PR only fixes the Compose host identity.
Compatibility
Single-instance Compose deployments only. The pinned hostname is stable across recreates and upgrades. Service DNS is unaffected:
platformstays a Compose network alias, so the defaultAGENTFLOW_PLATFORM_MCP_URL=http://platform:8080keeps working. Operators that override the platform service (for example with acompose.override.yaml) should keep the hostname or pin their own stable value.Validation
docker compose --profile platform configrendershostname: loopforge-platformon the platform service with the release.env.python3 scripts/check-public.pypasses on the patched worktree.ensurecall returnedavailable: truein about two seconds instead of the control-channel error.go test -p=2 ./...); no Go code changed.Safety