Skip to content

local deployment: give the lead and ops workspace host reach, merge rights and capacity #253

Open

Description

@ibetitsmike

Xum created this issue on behalf of @ibetitsmike.

Part of moving the pstack lead ("Pstack General", Xum workspace 8ac7791132) to a Coder Agents chat on this fork. This one is setup on Mike's Mac and not a chatd feature, and it needs Mike's decisions.

Gap

The lead and ops run on the Mac itself. A Coder Agents chat runs in a Docker workspace in the Colima VM and reaches none of this. Bash calls that touch host-only resources, from the Xum transcripts:

Resource Lead (of 3729) Fork ops (of 6017)
gh as Mike (181 lead calls contain gh pr merge) 1752 513
~/Library/Logs/coder (autodeploy and server logs) 341 427
psql on the daily database 225 623
coder-local (status, build, use, rollback) 147 774
Colima and Docker on the host 97 1285
launchctl 32 101
Other agents' scratch files (evidence checked by shasum) 157 636

Known limits of a workspace today:

  • The workspace GitHub token (coder external-auth access-token github) can push branches but cannot delete them. Whether it can merge pull requests, edit issues and post the @codex review comment has not been tested.
  • The daily server answers at host.docker.internal:3000 from a container, but logs, launchctl and coder-local do not exist there.
  • Colima has 6 CPUs and 12 GB of memory. The Xum workspaces share 30 cores and 256 GB, and ops already limits Go runs in Colima to one at a time.
  • The UAT server on :3100 and its swap procedure are host-side.

Decisions for Mike

  1. How the lead and ops reach the host: a narrow host bridge (read-only health, logs and coder-local status, plus named actions such as "pause autodeploy"), SSH from the workspace to the Mac, or ops stays in Xum and only the lead and the workstreams move.
  2. Which GitHub credential the lead uses to merge.
  3. How much CPU, memory and disk Colima gets.

Wanted

  • A pstack-lead template or workspace with gh, the fork checkout and the chosen host reach.
  • A tested list of what the lead's GitHub credential can do: merge with --match-head-commit, edit issue pstack parity: tracking #4, comment, delete a branch.
  • The post-deploy health check from the lead's runbook (buildinfo, migration version, anonymous 401 probe, server log errors) runs from the workspace.

Acceptance

  • From a chat in that workspace, the health check prints the same values as on the host.
  • A test pull request is merged from the chat with the head commit pinned.

Activity

  1. added
    pstack-parity
    needs-mike
    on Nov 12, 2026
  2. ibetitsmike commented on Nov 12, 2026

    @ibetitsmike
    OwnerAuthor

    Xum posted this comment on behalf of @ibetitsmike.

    Tracked in #255.

  3. ibetitsmike commented on Nov 12, 2026

    @ibetitsmike
    OwnerAuthor

    Xum posted this comment on behalf of @ibetitsmike.

    Decision 1 (host reach), from Mike on 2026-11-12: the lead that redeploys and monitors operates on the Mac itself through the Coder agent binary, as a workspace with an externally managed agent. The chat's tools then run on the host like in any Coder Agents workspace. No host bridge and no SSH.

    What the code on main already does:

    • A chat can use an existing workspace whose template has a coder_external_agent. When that agent is not connected or is offline, the turn fails with a message that asks the user to start it on its host (coderd/x/chatd/chattool/external_agents.go:20-25, turn_environment.go:1782).
    • create_workspace refuses such templates (external_agents.go:15), so the workspace is created once by hand and the lead chat is started on it with workspace_id.
    • spawn_agent with isolation: "workspace" fails from such a workspace (docs/fork/pstack-adapter.md, Workspace isolation). shared and worktree children run on the host.

    Work that follows from the decision:

    • A template with a coder_external_agent on the daily server (it has only docker and devcontainer today) and one workspace from it, for example mac-host.
    • A LaunchAgent on the Mac that runs the agent as Mike and restarts it, so it reconnects after each autodeploy restart of coderd. The agent binary must be a darwin arm64 build that matches the server, and it must be refreshed on deploy. Check whether coder-local build embeds a darwin slim binary or only the linux ones.
    • PATH and environment for execute, which runs sh -c without the login profile: gh, psql, coder-local, fnm node.
    • A rule for children: shared and worktree children of this lead run on the host, so the "Go builds only in Colima" rule and the ops slot protocol must be in the lead's runbook (pstack lead: port the lead, ops and workstream roles to Coder Agents and pilot one workstream #254). Workstreams that build should be spawned from a Docker workspace instead, which needs a second root or chatd: let a chat message its parent and siblings in the family #247 for the lead to reach them.
    • Add the host agent to the restart test in chatd: prove that a busy chat family survives an autodeploy restart #252: the agent reconnects and the lead's turn resumes after a deploy.

    Effect on the other decisions: an agent that runs as Mike uses Mike's gh login from the keychain, so decision 2 (merge credential) is answered unless Mike wants a narrower credential. Decision 3 (Colima size) is still open and now applies only to the workstream workspaces.

  4. ibetitsmike commented on Nov 12, 2026

    @ibetitsmike
    OwnerAuthor

    Xum posted this comment on behalf of @ibetitsmike.

    Decision 3 (Colima size), from Mike on 2026-11-12: give Colima more resources when the migration happens. Not before.

    Mike named no numbers. Proposal to confirm at cutover:

    Procedure, as for the disk growth on 2026-11-09: wait until no UAT or chat workspace is busy, brew services stop colima, edit cpu and memory in colima.yaml, brew services start colima, then check that the workspace containers and their agents come back.

    • Measure free host memory at cutover and fix the numbers
    • Resize Colima and verify the workspaces reconnect
    • Update the slot rule in the runbook
  5. ibetitsmike commented on Nov 12, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    Mike answered decision 2 on 2026-11-12: the lead merges with Mike's own gh login, as it does today. All three decisions are now set: (1) the lead runs as an external-agent workspace on the Mac, (2) merges use Mike's gh login, (3) Colima is resized at cutover.

  6. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum posted this comment on behalf of @ibetitsmike.

    Mike changed decision 1 on 2026-11-13: ops and deployments stay in Xum, so no external-agent workspace on the Mac is needed for the maintainer. The maintainer chat runs in a Docker workspace on Colima (image fork-dev:local, built today). The work items under decision 1 above no longer apply. Decision 3 (Colima size) and the experiment list wait for Mike to confirm them in the Fork ops workspace. State and open points: see the cutover comment on #255.

  7. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum acted on behalf of @ibetitsmike.

    State on 2026-11-13 21:30Z, which replaces my earlier comment:

    • Ops stays in Xum (Mike's decision). The Coder Agents maintainer gets no host reach; that part of this issue is not needed for the cutover.
    • Merge rights: the maintainer merges (Mike's decision), with a token limited to this repository, stored in the workspace home volume.
    • Capacity: Colima is at 16 CPUs and 32 GB. Free disk is 64 GB; Fork ops alerts under 50 GB.
    • Still open: the maintainer cannot ask Fork ops for a Go slot, so its Go runs can overlap with runs from Xum workspaces. See Move the pstack lead to Coder Agents: capability gaps and cutover #255 for the cutover record.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-mikepstack-parity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions