fix: tunnel button stuck on "Connecting..." when already running

Re-broadcast tunnel:started SSE event when tunnel is already active
and user toggles the setting, so the client receives the URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-02-27 16:31:31 +01:00
co-authored by Claude Opus 4.6
parent 45aaf7f09a
commit 1b0a540919
4 changed files with 12 additions and 2 deletions
+6
View File
@@ -1,5 +1,11 @@
# codeman
## 0.2.3
### Patch Changes
- Fix tunnel button stuck on "Connecting..." when tunnel is already running on the server
## 0.2.2
### Patch Changes
+1 -1
View File
@@ -50,7 +50,7 @@ When user says "COM":
4. **Sync CLAUDE.md version**: Update the `**Version**` line below to match the new version from `package.json`
5. **Commit and deploy**: `git add -A && git commit -m "chore: version packages" && git push && npm run build && systemctl --user restart codeman-web`
**Version**: 0.2.2 (must match `package.json`)
**Version**: 0.2.3 (must match `package.json`)
## Project Overview
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "codeman",
"version": "0.2.2",
"version": "0.2.3",
"description": "The missing control plane for AI coding agents - run 20 autonomous agents with real-time monitoring and session persistence",
"type": "module",
"main": "dist/index.js",
+4
View File
@@ -4033,6 +4033,10 @@ NOW: Generate the implementation plan for the task above. Think step by step.`;
if (tunnelEnabled && !this.tunnelManager.isRunning()) {
this.tunnelManager.start(this.port, this.https);
console.log('Tunnel started via settings change');
} else if (tunnelEnabled && this.tunnelManager.isRunning() && this.tunnelManager.getUrl()) {
// Tunnel already running — re-emit so the client gets the URL
this.broadcast('tunnel:started', { url: this.tunnelManager.getUrl() });
console.log('Tunnel already running, re-broadcast URL to client');
} else if (!tunnelEnabled && this.tunnelManager.isRunning()) {
this.tunnelManager.stop();
console.log('Tunnel stopped via settings change');