Skip to content

Kit gaps from the plain-Linux server move rehearsal (pc-agents user, golive lock, CPU in t3-capacity) #1047

Closed

Description

@scuttletoby

Findings from a rehearsal of moving a live T3 server to a plain-Linux machine (Ubuntu, btrfs). The move itself worked; these are the kit gaps it hit.

Decided: the server runs as upstream's own user service (t3code.service) under a dedicated user with linger, not as a system unit. golive, agent scopes and heavy/t3-capacity agent counting all assume a user manager, so no kit change is needed for that.

To fix:

  1. pc-agents plain-Linux mode cannot adopt an existing agent user. fork-kit/pc-agents/lib/pc_agents.py hardcodes the user name and /home/agent; user_problem wants the default uid, that home and no extra groups; sudo_problem flags any extra sudo rule not in the exact sudoHelpers form; masks() masks user@<uid>.service, which breaks linger and rootless Docker for that user. Needed: config options for user, home and uid; an allow-list for extra sudo rules; and a way to keep the user manager (linger, rootless Docker) on plain Linux.
  2. golive run as root leaves a root-owned lock (fork-kit/golive/lib/golive/journal.py, lock creation). The service user then cannot take the lock. Either refuse to run as root when the state folder belongs to another user, or create the lock with the folder's owner.
  3. t3-capacity ignores CPU load and containers started outside heavy. With the CPU fully busy (load about 2x the thread count, from containers the agent user started itself) it still said OK for a 6 GB build. Add a CPU rule (load or CPU pressure) to capacity-rule.json, and count container memory that runs outside heavy.
  4. Server unit examples should accept exit code 130. T3 exits 130 on SIGTERM, so every stop shows as "failed" unless the unit has SuccessExitStatus=130. Add it wherever the kit or docs ship a unit.
  5. Health checks must wait for "ready". A request sent after "Listening" but before "T3 Code server is ready" hung for over 5 minutes. Kit health checks (golive and others) should wait for the ready line. Check upstream for the same hang before changing the server.
  6. pc-agents plain-Linux mode is not on ci-release yet, so the bootstrap still installs the WSL2-only version. Cut a release once 1 is done.

Also seen: a SQLite database on compressed btrfs read at about 41 MB/s. Move docs should say to turn compression off for the userdata folder before the database lands there.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions