Skip to content

🤖 feat: bash AI proxy for SSH and Coder hosts through reverse forwards - #5774

Merged
ThomasK33 merged 12 commits into
bash-ai-proxy/2-stablefrom
bash-ai-proxy/3-ssh
Oct 6, 2026
Merged

ThomasK33 merged 12 commits into
bash-ai-proxy/2-stablefrom
bash-ai-proxy/3-ssh

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Bash commands on SSH and Coder hosts now get the proxy variables too. Xum opens a reverse SSH forward to each host, on the host's 127.0.0.1.

PR 3 of 4. It builds on PR 2.

Implementation

  • SSHTransport.openReverseForward:
    • OpenSSH runs ssh -N -R with ControlPath=none.
    • ssh2 uses forwardIn on a dedicated connection. Sharing the exec connection stalled against sshd keepalives.
  • ReverseForwardManager (reverseForwards.ts) opens one forward per host and checks it end to end with a nonce challenge on the proxy's health path. It keeps the remote port in the state file, so a restart reuses it.
    • At startup, Xum restores forwards to SSH hosts, but not to Coder workspaces, because connecting can start a stopped workspace.
    • A host that refuses forwarding (AllowTcpForwarding no) gets no variables. Xum tries it again after 5 minutes. Connection or probe failures retry after 30 seconds.
    • The forward process carries only Xum's -R: it starts with ClearAllForwardings=yes, and Xum adds the -R with ssh -O forward, so forwards in ~/.ssh/config cannot make it exit.
    • Each host keeps up to 8 workspace IDs for restore, and proxy traffic keeps the host's usedAt fresh.
    • The first turn on a host waits up to 10 seconds for the forward.
  • Turning the switch off closes the forwards that Xum owns. stop() is bounded.
  • Docs: a CAUTION about shared SSH hosts. The key travels in the remote command line, so other users on that host can read it with ps.

Validation

  • SSH2Transport.reverseForward.test.ts runs against an in-process ssh2 server.
  • tests/runtime/bashAiProxyReverseForward.test.ts (integration, Docker sshd) passes for both transports: 2 of 2 on the tested head.

Risks

Medium, but only with the switch on. SSH transport changes add a new method and a dedicated-connection path in SSH2ConnectionPool. Existing exec paths do not change. Known limits:


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $32.63

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T20:47:05.812513Z 2170004 New commits
🔒 Security Review ✅ Completed 2026-10-06T20:44:33.853736Z 2170004 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ThomasK33
ThomasK33 added this pull request to stack #5776 October 6, 2026 18:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7bb3c0dff

ℹ️ 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".

Comment thread src/node/runtime/transports/OpenSSHTransport.ts
Comment thread src/node/services/bashAiProxy/bashAiProxyService.ts Outdated
Comment thread src/node/services/bashAiProxy/bashAiProxyService.ts Outdated
Comment thread src/node/runtime/transports/OpenSSHTransport.ts Outdated
Comment thread src/node/services/bashAiProxy/reverseForwards.ts Outdated
Comment thread src/node/services/bashAiProxy/bashAiProxyService.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cdb1e8f1f3

ℹ️ 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".

Comment thread src/node/services/bashAiProxy/bashAiProxyService.ts
Comment thread src/node/services/bashAiProxy/bashAiProxyService.ts
# Conflicts:
#	docs/config/providers.mdx
#	src/node/services/agentSkills/builtInSkillContent.generated.ts
# Conflicts:
#	src/node/services/bashAiProxy/proxyState.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4e7a4f9e2

ℹ️ 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".

Comment thread src/node/services/bashAiProxy/reverseForwards.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b85b71d89

ℹ️ 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".

Comment thread src/node/services/bashAiProxy/bashAiProxyService.ts Outdated
Comment thread src/node/services/bashAiProxy/bashAiProxyService.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad557e732d

ℹ️ 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".

Comment thread src/node/services/bashAiProxy/reverseForwards.ts
Comment thread src/node/services/bashAiProxy/reverseForwards.ts
…wards when another backend shares the Xum home

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21700046b9

ℹ️ 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".

Comment thread src/node/services/bashAiProxy/bashAiProxyService.ts
Comment thread src/node/services/bashAiProxy/bashAiProxyService.ts
Comment thread src/node/services/bashAiProxy/bashAiProxyService.ts
Comment thread src/node/services/bashAiProxy/bashAiProxyService.ts
@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit 3638be4 Oct 6, 2026
60 of 63 checks passed
@ThomasK33
ThomasK33 deleted the bash-ai-proxy/3-ssh branch October 6, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant