Skip to content

feat(remote): add ssh port forwarding tool#676

Merged
XingYu-Zhong merged 1 commit into
KunAgent:developfrom
luoye520ww:codex/remote-port-forward
Jul 1, 2026
Merged

feat(remote): add ssh port forwarding tool#676
XingYu-Zhong merged 1 commit into
KunAgent:developfrom
luoye520ww:codex/remote-port-forward

Conversation

@luoye520ww

Copy link
Copy Markdown
Collaborator

Summary

  • Adds an SSH remote port forwarding tool for remote-bound threads.
  • Waits until the localhost tunnel is actually ready before returning a URL.
  • Cleans up per-thread tunnels to avoid orphan SSH processes.

Changes

  • Adds SSH port forward spawning and readiness probing.
  • Adds a per-thread remote port forward manager.
  • Adds the remote_port_forward built-in tool and wires runtime cleanup on thread resource disposal and shutdown.

Safety

  • Only available for SSH remote-bound threads.
  • Binds local tunnels to 127.0.0.1.
  • Allows automatic local port allocation; explicit local ports must be 1024-65535.
  • Requires remotePort to be 1-65535.
  • Production targets require explicit approval.

Stacking / dependency

Tests

  • npm.cmd --prefix kun test -- src/remote/ssh-port-forward.test.ts src/remote/remote-port-forward-manager.test.ts src/adapters/tool/remote-port-forward-tool.test.ts
  • npm.cmd --prefix kun run typecheck
  • git diff --check

@XingYu-Zhong XingYu-Zhong force-pushed the codex/remote-port-forward branch from d3fac5c to 979c9b8 Compare July 1, 2026 15:02

@XingYu-Zhong XingYu-Zhong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rebased onto current develop after remote core merge and verified port-forward tests plus kun typecheck.

@XingYu-Zhong XingYu-Zhong merged commit 0718c87 into KunAgent:develop Jul 1, 2026
luoye520ww pushed a commit to luoye520ww/DeepSeek-GUI that referenced this pull request Jul 1, 2026
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.

2 participants