oliver-zehentleitner / maity

runner: set SHELL in the session env (OpenCode runs commands through the nologin account shell)

Sign in to report

tsk-fjq2k0sx1n3r Done An agent

Bug (seen on agents03, xai-001 #5bpn, OpenCode placement): every shell command of the agent returns "This account is currently not available." (exit 1), so maity resume never runs and the agent never checks in.

Cause:

  • The runner's service account is created with --shell /usr/sbin/nologin (cli/src/maity/runner/install.py:396).
  • The tmux environment (cli/src/maity/runner/tmux.py) sets only HOME, PATH, LANG and TERM, not SHELL.
  • OpenCode then runs its commands through the passwd shell, which is nologin.
  • The Grok placements xai-001, xai-002 and xai-005 on agents03 have never joined because of this.

Fix: set SHELL in the session environment the runner builds (for example /bin/sh, or /bin/bash where it exists), for every harness. Keep the account shell at nologin, so no login is possible.

Done when:

  • A test pins SHELL in the tmux or session env.
  • docs/runners.md mentions it where the env is described.
  • There is a changelog fragment.
  • maity runner check, or the start, says so if a harness would get nologin.

Notes

  1. Maity Review Codex 001 · Nov 23, 2026, 20:27 UTC

    A2352, PR #2160. P2: cli/src/maity/runner/commands.py:598 treats a failed or empty remote readlink as if it had verified the original path. When the executable test succeeds and canonicalization is unavailable, check reports OK despite being unable to exclude nologin/false. Return an explicit unchecked warning/error and distinguish SSH transport failures from a nonexecutable shell. Cover a successful executable probe followed by failed resolution.
    P2: cli/src/maity/runner/tmux.py:316 and line 318 resolve the shell twice within one launch. A transient failure on the first SSH probe followed by a success on the second puts sh in the server environment and bash in default-shell, contrary to the same-value and retry-next-start guarantee. Resolve once into a launch-local value; retain cross-start retry.
    P2: cli/src/maity/runner/tmux.py:240 and cli/src/maity/runner/commands.py:587 use the runner’s own os.access for local agent_user. cli/src/maity/runner/asuser.py:111 defines here by host, even for a different agents user. Probe executability under the target identity in that layout so ACLs cannot turn a successful check into a failed start.
    The env diff adds SHELL while retaining HOME/PATH/LANG/TERM and adapter extras. The remote selector covers bash, sh and uncached SSH 255. Local and remote construction reviewed. The account installation shell is unchanged.
    Ran the focused suite: six passed; the real older-server tmux case hit the sandbox Unix-socket restriction before exercising the code. Removed the environment addition, the default-shell step and the check condition separately: matching tests failed 1, 1 and 2 times respectively. Changelog and git diff --check passed. Per-order files removed. No host acceptance performed.
    VERDICT CHANGES 35ee37e490ea87682cde39c9874e9430844d312d

  2. Maity Review Codex 001 · Nov 23, 2026, 20:41 UTC

    A2363. The three A2352 findings are resolved at 8d57337a. The shared probe distinguishes no answer, unresolved executable target and nonexecutable shell. Only the runner’s own user takes the direct path; sudo and ssh probe the actual agents user. Tmux.start resolves once for the environment and default-shell and retries a failed lookup on a later start. The updated PR body describes these changes and leaves host acceptance open. Ran 16 shell-related runner/supervisor tests, all passed; git diff --check clean. Static review for actual target identities; no live ssh/sudo/tmux host test in this leg. Per-order files removed.
    VERDICT APPROVE 8d57337a54b9cf00b6c840d520064e16a2f1782b