feat(sessions,daemon,vscode): instrument session status delivery - #2082
Merged
Merged
Conversation
CoverageTotal: 97.84% ⚪ 0.02 pp vs Comparing
🔇 244 ignored region(s), 0 tolerated region(s)
Patch coveragePatch: 99.83% (1151/1153 new lines covered)
Uncovered new lines (2)
Indirect coverage changes🔴 0 lines lost coverage, 🟢 11 lines gained coverage on unchanged code. Indirect changes
|
newhoggy
force-pushed
the
issue-1447-sessions-logging
branch
from
October 1, 2026 12:27
4e70efb to
8b05e18
Compare
newhoggy
enabled auto-merge
October 1, 2026 12:37
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 1, 2026
newhoggy
force-pushed
the
issue-1447-sessions-logging
branch
from
October 1, 2026 13:01
8b05e18 to
873ad4f
Compare
newhoggy
force-pushed
the
issue-1447-sessions-logging
branch
from
October 1, 2026 14:02
873ad4f to
530b028
Compare
newhoggy
enabled auto-merge
October 1, 2026 14:07
newhoggy
disabled auto-merge
October 1, 2026 14:11
newhoggy
force-pushed
the
issue-1447-sessions-logging
branch
from
October 1, 2026 23:32
530b028 to
3901815
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 1, 2026
Make session ingestion, registry decisions, subscription delivery, and companion rejection paths observable without changing session behavior. Add daemon tracing settings and a bounded opt-in wrapper metadata sink. Keep conversation content out of diagnostics and byte forwarding free of file I/O. Document troubleshooting and add regression coverage. Closes #1447
Serialize complete records before appending so simultaneous wrappers cannot interleave JSON tokens. Include timestamps and wrapper PID for correlation, and stop formatting records after the writer has failed. Add a concurrent-append regression and repair stream lifecycle docs.
Use let-else and if-let in diagnostic error branches, following the repository pedantic Clippy rules. Preserve outcomes and counters.
Close the remaining coverage gaps in the diagnostics added for #1447, mostly by testing the new log lines and failure arms directly rather than excluding them. Pull a few small seams out of the bodies that held the untestable branches, without changing behavior: - Diagnostics::drain takes the writer and receiver, so a failing writer can drive the abandon-the-log path. - HookCommand::read_input takes a reader, so a broken or non-UTF-8 stdin can be fed in. - watcher::session_id_of isolates the file-stem rule behind scan. - main::daemon_filter_from and emit_bootstrap_warnings split the bootstrap settings load from the warnings it owes once tracing exists. - Settings::warn_settings_fallback takes its dedup, so the once-only warning is asserted on a private one. Mark the arms that only an OS fault can reach (a thread that will not spawn, a read_dir error entry, a missing data directory) with coverage ignores that state why a test cannot reproduce them. Make capture_at and capture_future_at deterministic. tracing-core recomputes a callsite's cached interest against only the calling thread's default while a single dispatcher is registered, so a thread with no subscriber could cache "never" and silently drop the capturing test's event. Keeping one extra dispatcher registered for the life of the process keeps it on the path that consults every live dispatcher.
Clippy 1.99 deprecates `AtomicU64::fetch_update` in favour of `try_update`, which failed the Clippy CI job under `-D warnings`. `try_update` is newer than the 1.88 MSRV, so use a `compare_exchange_weak` loop instead: same saturating semantics, no deprecation on any toolchain. Add tests for the saturation bound and for lost updates under contention (which also exercises the retry path).
newhoggy
force-pushed
the
issue-1447-sessions-logging
branch
from
October 1, 2026 23:54
3901815 to
3978c87
Compare
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.
Description
Add diagnostics across session ingestion, registry decisions, daemon subscriptions, and VS Code consumption so stale or missing session cues can be investigated from evidence.
daemon.log_levelmakes tracing configurable for socket-activated launches;OMNI_DEV_CLAUDE_WRAP_LOGopts into bounded, metadata-only wrapper logs.Existing session transitions, PID takeover rules, attribution ranking, wire payloads, hook exit behavior, wrapper forwarding/title behavior, and companion reconnection policy are preserved.
Type of Change
Related Issue
Closes #1447.
Changes Made
src/utils/settings.rsandsrc/main.rs: daemon settings, validRUST_LOG→ daemon setting → default filter selection, and bootstrap warnings emitted after tracing initialization.src/daemon/server.rsand the sessions adapter: service rejection warnings, distinct stream termination reasons, pushed/suppressed sample diagnostics, write warnings, and repository-enrichment task failure diagnostics.claude_wrap/diagnostics.rs: optional bounded writer queue, restrictive new-file permissions, complete-record appends, timestamps/PID correlation, failed-writer disablement, and periodic/final counters. Conversation/tool content and arbitrary daemon error text are excluded. Unknown notifications likewise log classification metadata rather than raw message text, refining the issue proposal's privacy handling.Testing
--all-targets -- -D warnings) passed.Rebased cleanly onto current main and reran extension checks. Rust sources are identical to the validated tree after this rebase.
Validation commands use the feature worktree's manifest or extension directory:
Socket fixtures were run outside the filesystem/network sandbox. The MCP suite and isolated smoke use private request-log fixtures, preventing the always-on GitHub counter service from scanning the live request log.
Coverage percentages were not measured locally; the repository CI coverage job will report them. Native launchd/systemd activation and an interactive VS Code host were not exercised manually.
Review Focus Areas
Metadata allowlisting and fail-open logging; filter precedence/bootstrap warnings; accurate registry bump and stream lifecycle accounting. Post-commit review found and fixed interleaved JSON appends and continued formatting after writer failure. Commit messages were checked with commit-twiddle.
Checklist
Performance and Security Considerations
High-volume sampling stays at trace level; watcher/parser/tee diagnostics use summaries or counters. Disabled wrapper logging creates no writer or tee-counter allocation and formats no diagnostic records. Enabled logging adds a bounded independent queue and at most 200 ms of shutdown flushing. Files append without automatic rotation; queue saturation, disk failure, or process termination can lose records.
Wrapper logs persist identifiers, cwd/model metadata, and outcomes only. Newly created files use
0600; symlinks and nonregular targets are refused. Existing file permissions remain under the user's control. The pure registry remains in memory, and session behavior is unchanged.Deployment Notes
Restart the daemon after changing
daemon.log_level. Enable the optional wrapper log in the environment of newly launched wrapper processes. Troubleshooting docs describe reading, disabling, and removing logs. Diagnosing/fixing the suspected broadcast bug and canonicalizing attribution paths remain follow-up work.