chore(sight): fix HTTP/2 Huffman decode + dead-code/warning cleanup + docs#663
Merged
Merged
Conversation
This was referenced May 30, 2026
a02341a to
0ee2e07
Compare
Hygiene pass over the crate (no behavior change): - Delete compiler-confirmed dead code: the orphaned token-computation cluster in analyzer/unified.rs (compute_prompt_tokens / compute_token_consumption_with_template / compute_output_token_breakdown_from_json, ~265 lines), the unused comm_to_string in sslsniff.rs, and get_pending_calls_for_pid in health/checker. - Remove two `todo!()` public stubs in tokenizer/llm_tok.rs (from_url, messages_to_json) that would panic if ever called and had no callers. - Replace deprecated base64::encode with the Engine API (base64 0.22). - Make AgentSight::set_ffi_sender pub(crate) so it no longer leaks the crate-internal FfiEventSender type. - Drop unused imports (via cargo fix) and silence a few unused-variable bindings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The bindgen header + libbpf skeleton blocks (mod bpf { include!(...) }) emit
~100 non_camel_case_types / non_upper_case_globals / dead_code warnings that
drowned out real signals. Annotate each of the 7 probe modules' generated
include block with a scoped #[allow(...)] instead of touching generated code.
Also clear the remaining real warnings: a dead trailing bind_idx increment in
token_consumption.rs, the unused format_duration_ns CLI helper, and an unused
test binding. The crate now builds warning-free (lib + tests + bins), making a
future -D warnings gate viable.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The docs drifted behind the 7 merged probes and 6 Event variants: - AGENTS.md: Event enum listed 4 of 6 variants and the probe table 4 of 7 probes; add FileWrite/UdpDns + filewrite/udpdns/tcpsniff. - integration-tests/README.md: pointed at nonexistent test_sni.md / test_hermes_sni.md and omitted the real test_dns/test_hermes_dns/test_http/ test_connection_scanner/test_ffi_integration entries. - docs/design-docs/ebpf-probes.md: said "4 probes"; document all 7 (diagram, detail sections, and the ring-buffer source-value table). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0ee2e07 to
9a3daca
Compare
Daydreamer-Li
approved these changes
Jun 2, 2026
Daydreamer-Li
left a comment
Collaborator
There was a problem hiding this comment.
LGTM — thanks for the sight dead-code cleanup and docs sync.
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
Independent polish pass on
sight(offmain, no dependency on the lineage/scheduler PRs). Four focused commits:ParsedHttp2Frame::huffman_decode()returned a"<huffman:N bytes>"placeholder, so any Huffman-encoded HTTP/2 header (:path,:status, content-type, header values) was unreadable, breaking path classification / SSE detection for HTTP/2 LLM-API traffic. Now delegates to the already-importedhpackcrate's RFC 7541 decoder, with RFC test vectors.analyzer/unified.rs, the unusedcomm_to_string/get_pending_calls_for_pid, and twotodo!()public stubs intokenizer/llm_tok.rs(latent panics); replace deprecatedbase64::encode; makeset_ffi_senderpub(crate)(was leaking a crate-internal type); drop unused imports.#[allow(...)]to each probe'smod bpf { include!(...) }block (bindgen/skeleton output) and clear the last hand-written warnings. The crate now builds warning-free (lib + tests + bins).Test plan
cargo buildclean: 0 warnings across lib + tests + binsGenerated with Claude Code
Update (polish)
Huffman fix split out to #670 —
fix(sight): decode HPACK Huffman headers. Force-pushed to drop commit63fad98from this stack so the diff is now scope-clean (polish/cleanup/docs only).Update (2026-06-02 conflict-fix rebase)
Rebased onto post-Huffman
main(#670 merged). Theframe.rsrustfmt conflict (predicted inCLAUDE.md's rebase note: rustfmt commit recreated against new base) was resolved by the canonical recipe — drop the original rustfmt commit, replay clippy commits, then runcargo fmtonce on the new base to produce a fresh rustfmt commit. While in rebase mode, also normalised every commit subject to ≤50 chars (thecommit msg ≤50rule mandates re-checking inherited subjects on amend).