feat(tui): add ssh remote runtime transport (with hardening fixes)#4
feat(tui): add ssh remote runtime transport (with hardening fixes)#4kousw wants to merge 8 commits into
Conversation
|
@codex |
1 similar comment
|
@codex |
💡 Codex Reviewcodelia/crates/tui/src/main.rs Lines 695 to 696 in 2a2ec1f The new codelia/crates/tui/src/app/runtime/client.rs Line 112 in 2a2ec1f In SSH mode, the fallback remote command is ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…tui-remote-runtime-ssh-79a4444e # Conflicts: # crates/tui/AGENTS.md # crates/tui/src/app/runtime/client.rs # crates/tui/src/main.rs
…ote runtime config layering policy
…tui-remote-runtime-ssh-79a4444e # Conflicts: # crates/tui/src/app/runtime/client.rs # crates/tui/src/main.rs # docs/specs/backlog.md
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad2ee13a43
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| app.push_line(LogKind::Status, format!("Clipboard request: {prompt}")); | ||
| } | ||
| let _ = (run_id, purpose); | ||
| let result = match read_clipboard_image_attachment(max_bytes) { |
There was a problem hiding this comment.
Require consent before serving clipboard read RPC
handle_clipboard_read_request reads and returns local clipboard image data immediately on any ui.clipboard.read request, without a confirmation/approval step tied to user intent. In SSH mode this lets a compromised or misbehaving remote runtime exfiltrate local clipboard contents just by emitting the RPC, even when the user never initiated paste/attach, so this path needs an explicit consent gate (or equivalent policy check) before read_clipboard_image_attachment is called.
Useful? React with 👍 / 👎.
| let joined = defaults | ||
| .into_iter() | ||
| .chain(ssh_parts) |
There was a problem hiding this comment.
Preserve user SSH option precedence over defaults
This builds CODELIA_RUNTIME_SSH_OPTS by placing default -o options before user-supplied --ssh-option values; with OpenSSH, duplicate options are resolved from the first occurrence (you can observe this via ssh -G), so a user-provided override like --ssh-option StrictHostKeyChecking=no is ignored once the default StrictHostKeyChecking=yes is prepended. That makes the new CLI flag unexpectedly ineffective for conflicting keys and can block valid connection setups.
Useful? React with 👍 / 👎.
概要
TUI から runtime を SSH 経由でリモート起動できるようにする変更です。
あわせて、運用時に問題になった SSH 起動まわりの不具合(bootstrap スクリプト、SSH オプション保持、diagnostics 伝搬、
--ssh不正指定時の挙動)を修正しています。主な変更
1) TUI の SSH リモート実行オプション追加
--ssh <user@host>--ssh-port <port>--ssh-identity <path>--ssh-option <key=value>(複数可)--remote-command <cmd>--remote-cwd <path>上記を runtime 用環境変数へ変換して起動するようにしました。
2) runtime クライアントの SSH 起動実装
ssh -T ... sh -lc <script>を使って remote runtime を起動3) フォローアップ修正(レビュー反映)
if/whileを含む bootstrap script を"; "結合していた問題を修正(改行区切りへ)--ssh-port/--ssh-identity/--ssh-option使用時も、デフォルト SSH 安全オプション(BatchMode / StrictHostKeyChecking / keepalive)を保持
--diagnosticsを remote runtime にも伝搬(CODELIA_DIAGNOSTICS=1を remote script で export)--ssh値欠落時に local へ黙ってフォールバックしないよう修正(SSH モードとして扱い、起動失敗で明示)--remote-commandの場合は codelia/npm bootstrap を強制しない(条件付き bootstrap)4) UI clipboard read の capability ガード
ui.clipboard.readをsupports_clipboard_readでガードドキュメント
crates/tui/AGENTS.mdに SSH transport / clipboard read 対応の要点を追記テスト
実施済み:
cargo test --manifest-path crates/tui/Cargo.toml(最新 139 passed)bun run testbun run typecheck既知の前提/仕様
remote project > remote global(local global 混在は未導入)チェックリスト
--remote-commandが bootstrap 非依存で実行可能--ssh不正指定で明示的に失敗