fix(terminals): enable the web terminal in the ephemeral-pod topology (daemon-host zellij gate) - #2083
Open
garciajrx wants to merge 2 commits into
Open
fix(terminals): enable the web terminal in the ephemeral-pod topology (daemon-host zellij gate)#2083garciajrx wants to merge 2 commits into
garciajrx wants to merge 2 commits into
Conversation
…ephemeral mode The terminal spawns an executor with `zellij.attach`, so under executor_command_template (ephemeral/templated execution) the PTY runs in the executor image, not on the daemon host. The availability probe ran `which zellij` on the daemon host and disabled terminals whenever the daemon image lacked zellij — which is always in the Cloud pod topology. Treat zellij as available when execution is offloaded; keep the daemon-host probe only for local_process. Pairs with the executor image adding zellij (preset-io/agor-cloud). Not covered: the pgrep-based session adoption still assumes daemon/executor co-location, so reconnecting to a surviving session after a daemon restart needs a follow-up.
…ranch The service constructor now reads loadConfigSync() to detect executor offload, but terminals.test.ts did not mock it — under vitest an unmocked named export is a hard error, so 14 of 16 tests failed at construction. Mock loadConfigSync and add two tests: host-absent + not offloaded rejects creation; host-absent + offloaded treats Zellij as available and spawns.
Contributor
Author
|
Adversarial review flagged a ship-blocker: the constructor's new Fixed in c8799c6:
Rollout note from the review (L3): deploy the executor image with Zellij (agor-cloud #206) before the daemon. If the daemon rolls first, offloaded Cells will pass the guard and only surface a generic |
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.
Problem
The web terminal shows "Zellij isn't installed on the daemon host" and is disabled on Cloud Cells, even though the daemon isn't where the shell runs.
TerminalsServiceprobeswhich zellijon the daemon host and setszellijAvailablefrom it. But the terminal spawns an executor withcommand: 'zellij.attach'— so underexecutor_command_template(ephemeral/templated execution) the PTY runs in the executor image, in a separate pod. The daemon-host probe is a leftover from thelocal_processmodel where the executor ran as a subprocess on the daemon host. Theagor-daemonimage has no zellij, so the gate always fails in the pod topology.Change
terminals.ts— when execution is offloaded (execution.executor_command_templateset), treat zellij as available (it's in the executor image); otherwise keep the daemon-host probe forlocal_process:Pairs with
preset-io/agor-cloud — adds
zellijtoDockerfile.executor(the image where the PTY actually runs). Both are needed together.Not covered (follow-up)
The session-adoption logic (
pgrep -f 'zellij attach …') alsopgreps the daemon host, so reconnecting to a surviving session after a daemon restart still assumes daemon/executor co-location and won't find pod-based executors. Basic spawn -> PTY streaming works (the executor connects back to the daemon service); adoption/reconnect-after-restart needs a separate rework.