Repository navigation
feat(connect,status): cold-start phase telemetry (Windows UX) - #549
Merged
Merged
Conversation
Codex-spec'd UX follow-up to #545/#546: emit "→ [t+Ns] phase…" lines at the top of slow operations so a user staring at a Monitor task can tell "still working" from "hung." Without this, Windows Monitor cold-starts produced 30-60s of total silence followed by a flood of host-setup output — indistinguishable from a hang. Helper: `_join_phase` (in cmd_connect.sh) - t0 anchored via $AIRC_WRITE_DIR/.cold_start_t0; survives across `_reexec_into host` (same scope, no env passing required). - Output goes to BOTH stdout (so Monitor surfaces it as a user- facing event) AND $AIRC_WRITE_DIR/airc-transport.log (so post-mortem traces show where the time went). - `_join_phase_done` clears the marker once the monitor stream attaches — the next `airc join` against an already-warm scope starts from t0=0 again, not "minutes since last boot." Phase markers added at the slow points: - querying gh for mesh on this account (#X) - resolving room gist contents (<id>) - taking over stale host (re-exec into host mode) - hosting as 'NAME' — bootstrapping room gist - publishing host lease to existing room gist / creating new room gist on this gh account - subscribing to #general (sidecar) - monitor stream attached — cold start complete cmd_status: distinguish "starting" from "not running" Pre-fix `airc status` reported `airc process: not running` whether airc was genuinely absent OR mid-cold-start. Post-fix: - If `.cold_start_t0` exists AND age <= 600s, status reports `starting (airc join cold-start in progress, t+Ns)`. - Stale-marker guard: anchors >10min old are treated as orphaned (a join crashed without cleanup) and ignored, so the user gets the actionable "not running" message instead of a perpetually- rising "starting (t+86400s)". - cmd_connect entry-point also self-cleans stale anchors so a fresh join starts from a clean clock. Verified locally on Windows WSL2 with isolated AIRC_HOME: $ bash test/smoke-coldstart → [t+0s] querying gh for mesh on this account (#general) → [t+15s] resolving room gist contents (c68640ec...) → [t+17s] taking over stale host (re-exec into host mode) → [t+21s] hosting as 'win-continuum-8e97' — bootstrapping room gist → [t+25s] publishing host lease to existing room gist → [t+25s] subscribing to #general (host-mode sidecar) → [t+26s] monitor stream attached — cold start complete $ airc status airc process: starting (airc join cold-start in progress, t+34s) airc-transport.log includes per-phase timing entries for post-mortem of slow cold-starts. Doesn't change any control-plane behavior — pure observability addition. Single-source PATH invariant from #545 preserved. Related — Windows Monitor cold-start surface trail: #533/#538/#541/#542/#543/#544/#545/#546 — correctness fixes THIS — UX/observability for the cold-start latency that remains after correctness is solid. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds cold-start phase telemetry to airc join/connect and improves airc status messaging so Windows/Monitor users can distinguish “still starting” from “hung/not running” during slow cold-start discovery/handshake periods.
Changes:
- Introduces
_join_phase/_join_phase_doneto emit time-anchored phase markers to stdout and to a scope log, including stale-anchor cleanup. - Adds phase markers at several known slow points in
cmd_connect. - Updates
cmd_statusto reportstarting (…t+Ns)when a cold-start marker exists and is fresh (≤ 10 minutes).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/airc_bash/cmd_connect.sh | Adds cold-start phase telemetry helpers, stale marker cleanup, and phase emissions around slow operations. |
| lib/airc_bash/cmd_status.sh | Adds “starting” status based on the cold-start anchor age when no pidfile exists yet. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+58
to
+63
| printf ' → [t+%ds] %s\n' "$_elapsed" "$*" | ||
| if [ -n "${AIRC_WRITE_DIR:-}" ] && [ -d "$AIRC_WRITE_DIR" ]; then | ||
| printf '%s [t+%ds phase] %s\n' \ | ||
| "$(date -u +%FT%TZ 2>/dev/null || echo "?")" \ | ||
| "$_elapsed" "$*" \ | ||
| >> "$AIRC_WRITE_DIR/airc-transport.log" 2>/dev/null || true |
This was referenced May 7, 2026
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.
Summary
Codex-spec'd UX follow-up to #545/#546. Without this, Windows Monitor cold-starts produced 30-60s of total silence followed by a flood of host-setup output — indistinguishable from a hang.
Pure observability addition. No control-plane behavior changes. Single-source PATH invariant from #545 preserved.
Helper:
_join_phase(incmd_connect.sh)$AIRC_WRITE_DIR/.cold_start_t0; survives_reexec_into host(same scope, no env passing required)$AIRC_WRITE_DIR/airc-transport.log(post-mortem traces show where the time went)_join_phase_doneclears the marker once the monitor stream attaches — nextairc joinagainst an already-warm scope starts from t0=0 againcmd_connectfor crashed-prior-join anchors >10min oldPhase markers added at slow points
_mesh_find_any(gh gist list)gh api gists/<id>gh gist editgh gist create(alt path)spawn_general_sidecar_if_wantedcmd_status— distinguish "starting" from "not running"Pre-fix
airc statusreportedairc process: not runningwhether airc was genuinely absent OR mid-cold-start. Post-fix:.cold_start_t0exists AND age ≤ 600s →starting (airc join cold-start in progress, t+Ns)not runningso user gets the actionable messageLive verification
Smoke run on Windows WSL2 (isolated AIRC_HOME, fresh discovery, stale prior host triggering takeover):
airc-transport.log(post-mortem):airc statusmid-cold-start (prior to the done marker clearing):Related — Windows Monitor cold-start surface trail
🤖 Generated with Claude Code