chore: promote staging to staging-promote/14333e4a-24631327376 (2026-04-19 15:01 UTC)#2682
Merged
henrypark133 merged 3 commits intomainfrom Apr 21, 2026
Merged
Conversation
- Gate webhook, WASM, Signal, HTTP, gateway, tunnel, and orchestrator startup behind --cli-only - Restore the expected --cli-only contract so no non-CLI listeners bind or expose services - Prevent unintended network exposure from fallback listeners and managed tunnels - Stop registering job_prompt when no orchestrator is running to consume prompts - Fix sandbox readiness reporting under --cli-only so it reports disabled, not unavailable - Centralize the guard through non_cli_channels_enabled() for consistent startup behavior - Add regression coverage for unguarded network startup paths in async_main - Document --cli-only listener suppression in NETWORK_SECURITY.md
#1947) (#2008) `&tool.description[..57]` panics when byte 57 is inside a multi-byte character (CJK = 3 bytes, emoji = 4 bytes). Replace with `floor_char_boundary()` which walks back to the nearest valid boundary. Also fixes the same pattern in `config/channels.rs` where `&scope[..32]` could panic on non-ASCII OAuth scopes. Adds 4 regression tests: ASCII, CJK, emoji, and mixed-boundary truncation. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-authored-by: willamhou <willamhou@ceresman.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Happy <yesreply@happy.engineering>
…2680) Biggest single-slice migration in the epic: ten chat handlers + every chat-private helper + all chat helper-tests leave `server.rs` for a new `src/channels/web/features/chat/` module. Routes carried over end-to-end (no behavior change): - POST /api/chat/send, /api/chat/approval, /api/chat/gate/resolve - POST /api/chat/auth-token, /api/chat/auth-cancel (legacy v1 shims) - GET /api/chat/ws, /api/chat/events - GET /api/chat/history, /api/chat/threads - POST /api/chat/thread/new Chat-private helpers that moved along with the handlers: - `is_local_origin` (CSRF-gate for the WS upgrade) - `pending_gate_extension_name` → routes through the canonical `AuthManager::resolve_auth_flow_extension_name` (the identity invariant called out in `src/channels/web/CLAUDE.md` + check #8 in `scripts/pre-commit-safety.sh`); the wrapper is preserved byte-identical so the "one resolver" rule holds after the move. - In-progress reconciliation chain: `reconcile_in_progress_with_turns`, `in_progress_matches_turn`, `in_progress_from_metadata`, `is_stale_in_progress`, `completed_turn_is_newer_than_in_progress`, `in_progress_from_thread`, `summary_live_state`. - `turn_info_from_in_memory_turn`, `thread_state_label`, `turn_state_label`, `IN_PROGRESS_STALE_AFTER_MINUTES`. - `HistoryQuery`, `ChatEventsQuery` request DTOs and `extract_last_event_id` helper. - `engine_pending_gate_info` / `history_pending_gate_info` gate-info hydrators. Tests: 15 helper-level tests (5 reconcile, 2 in-memory-turn-info, 2 summary-live-state, 1 thread-state-label, 5 is-local-origin) move with the helpers into `features/chat/mod.rs::tests`. 8 caller-level tests (chat_history × 3, chat_approval, chat_auth_token × 2, chat_auth_cancel, chat_gate_resolve) stay in `server.rs::tests` for now because they rely on shared `GatewayState` builders (`test_gateway_state`, `test_gateway_state_with_store_and_session_manager`, `test_gateway_state_with_dependencies`) that construct state for multiple slices — promoting those builders to `src/channels/web/test_helpers.rs` is a follow-up. Also dropped 3 `test_build_turns_from_db_messages_*` tests in `server.rs` that were redundant with the 14 already in `util.rs::tests`. Cleanup of dead code: `src/channels/web/handlers/chat.rs` deleted entirely. The file held live `chat_events_handler` + `extract_last_event_id` + `ChatEventsQuery` (absorbed into `features/chat/`), plus three zombie duplicate handler definitions (`chat_ws_handler`, `chat_threads_handler`, `chat_new_thread_handler`) that predated the `server.rs` canonicals but were never deleted — one of them (`chat_ws_handler`) used a weaker `is_local_origin` heuristic that skipped IPv6-literal parsing, so accidentally wiring through it would have been a silent security degradation. The router.rs imports and `handlers/mod.rs` declaration are updated accordingly. Router updates: nine `server::` imports swapped for `features::chat::`, plus the `handlers::chat::chat_events_handler` import removed (now `features::chat::chat_events_handler`). The migration docstring above the feature-handler imports lists chat as extracted alongside logs / oauth / pairing / status. Quality gate: fmt clean, clippy clean on `--all --tests --examples --all-features`, 424 `channels::web` tests pass, boundary checker reports no back-edges with the existing empty allowlist. Net shape: `server.rs` shrinks from ~5,770 → ~3,620 lines (-2,150 lines). `handlers/chat.rs` goes from 432 → 0. Explicit non-scope (noted in the migration plan): - Four handlers (`chat_send`, `chat_ws`, `chat_threads`, `chat_new_thread`) gate side effects and currently have no caller-level test. Adding them is genuine new coverage, not regression preservation — a follow-up PR. The helper-level tests that DO cover things (`is_local_origin`, `reconcile_*`, `turn_info_from_in_memory_turn`, `summary_live_state`, `thread_state_label`) move with their helpers. - The pre-existing `engine_v2` / `engine_v2_enabled` duplicate in `GatewayStatusResponse` (flagged on PRs #2665 and earlier) still needs a coordinated frontend fix and isn't touched here. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code reviewNo issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto-promotion from staging CI
Batch range:
7fb41555a9e55677d1aaea29ca567a5b369c2b05..5fe3be8dcefdc24b3f67aa366617779ff07441a2Promotion branch:
staging-promote/5fe3be8d-24631759358Base:
staging-promote/14333e4a-24631327376Triggered by: Staging CI batch at 2026-04-19 15:01 UTC
Commits in this batch (12):
Current commits in this promotion (0)
Current base:
mainCurrent head:
staging-promote/5fe3be8d-24631759358Current range:
origin/main..origin/staging-promote/5fe3be8d-24631759358Auto-updated by staging promotion metadata workflow
Waiting for gates:
Auto-created by staging-ci workflow