Skip to content

feat: add web gateway hot reload and polling state sync#1684

Merged
wj-xiao merged 2 commits intosipeed:mainfrom
wj-xiao:feat/web-gateway-reload
Mar 17, 2026
Merged

feat: add web gateway hot reload and polling state sync#1684
wj-xiao merged 2 commits intosipeed:mainfrom
wj-xiao:feat/web-gateway-reload

Conversation

@wj-xiao
Copy link
Collaborator

@wj-xiao wj-xiao commented Mar 17, 2026

📝 Description

This PR makes the launcher-managed gateway reloadable and more resilient to config changes. It moves gateway startup and reload logic into pkg/gateway, allows picoclaw gateway to start in a limited mode when no default model is configured, and replaces the launcher/frontend SSE status flow with adaptive polling plus an explicit stopping state. The backend gateway health/proxy logic also now respects the configured bind host instead of assuming 127.0.0.1.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

N/A

📚 Technical Context (Skip for Docs)

  • Reference URL: N/A
  • Reasoning: The launcher needed a single gateway runtime that can be reused across CLI and web flows, plus a more reliable state-sync path during start/stop/restart transitions. Polling /api/gateway/status avoids stale SSE state, and host-aware health probing keeps launcher-to-gateway checks working when the configured bind host is not the default loopback address.

🧪 Test Environment

  • Hardware: Apple Silicon Mac (arm64)
  • OS: macOS 26.3.1
  • Model/Provider: Not exercised (launcher/gateway lifecycle and automated tests only)
  • Channels: Not exercised (web launcher and gateway API path only)

📸 Evidence (Optional)

Click to view Logs/Screenshots
make check
# passed locally

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

wj-xiao added 2 commits March 17, 2026 18:33
- extract gateway runtime into pkg/gateway
- add gateway.hot_reload config with default and example values
- allow starting the gateway without a default model via --allow-empty
- stop treating missing enabled channels as a startup error
- update related tests
- remove gateway SSE broadcasting and event endpoint
- add polling-based gateway status refresh with stopping state handling
- detect when gateway restart is required after default model changes
- resolve gateway health and websocket proxy targets from configured host
- update gateway UI labels and add backend/frontend test coverage
@wj-xiao wj-xiao merged commit 8a44410 into sipeed:main Mar 17, 2026
4 checks passed
dome pushed a commit to domeclaw/domeclaw that referenced this pull request Mar 17, 2026
* feat(gateway): support hot reload and empty startup

- extract gateway runtime into pkg/gateway
- add gateway.hot_reload config with default and example values
- allow starting the gateway without a default model via --allow-empty
- stop treating missing enabled channels as a startup error
- update related tests

* feat: replace gateway SSE updates with polling-based state sync

- remove gateway SSE broadcasting and event endpoint
- add polling-based gateway status refresh with stopping state handling
- detect when gateway restart is required after default model changes
- resolve gateway health and websocket proxy targets from configured host
- update gateway UI labels and add backend/frontend test coverage
vanitu pushed a commit to vanitu/picoclaw that referenced this pull request Mar 17, 2026
This merge brings in upstream changes including:
- zerolog logger refactoring (sipeed#1239)
- Anthropic Messages API support (sipeed#1284)
- Global WebSocket for Pico chat (sipeed#1507)
- ModelScope and LongCat providers (sipeed#1317, sipeed#1486)
- Web gateway hot reload and polling (sipeed#1684)
- Credential encryption with AES-GCM (sipeed#1521)
- Cross-platform systray UI (sipeed#1649)
- Security fixes for LINE webhooks, identity allowlist
- And many more improvements

Conflict resolved:
- pkg/agent/instance.go: merged buildAllowReadPatterns/mediaTempDirPattern
  functions from upstream while preserving A2A registry Close() handling

Custom features preserved:
- A2A channel (Agent-to-Agent protocol)
- Krabot channel
- Enhanced Docker multi-channel support
alexhoshina pushed a commit to alexhoshina/picoclaw that referenced this pull request Mar 17, 2026
* feat(gateway): support hot reload and empty startup

- extract gateway runtime into pkg/gateway
- add gateway.hot_reload config with default and example values
- allow starting the gateway without a default model via --allow-empty
- stop treating missing enabled channels as a startup error
- update related tests

* feat: replace gateway SSE updates with polling-based state sync

- remove gateway SSE broadcasting and event endpoint
- add polling-based gateway status refresh with stopping state handling
- detect when gateway restart is required after default model changes
- resolve gateway health and websocket proxy targets from configured host
- update gateway UI labels and add backend/frontend test coverage
j0904 pushed a commit to j0904/picoclaw that referenced this pull request Mar 22, 2026
* feat(gateway): support hot reload and empty startup

- extract gateway runtime into pkg/gateway
- add gateway.hot_reload config with default and example values
- allow starting the gateway without a default model via --allow-empty
- stop treating missing enabled channels as a startup error
- update related tests

* feat: replace gateway SSE updates with polling-based state sync

- remove gateway SSE broadcasting and event endpoint
- add polling-based gateway status refresh with stopping state handling
- detect when gateway restart is required after default model changes
- resolve gateway health and websocket proxy targets from configured host
- update gateway UI labels and add backend/frontend test coverage
@wj-xiao wj-xiao deleted the feat/web-gateway-reload branch March 23, 2026 01:52
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