Skip to content

Log handoff token counts#1954

Merged
tlongwell-block merged 1 commit into
mainfrom
wren/handoff-token-log
Jul 16, 2026
Merged

Log handoff token counts#1954
tlongwell-block merged 1 commit into
mainfrom
wren/handoff-token-log

Conversation

@tlongwell-block

Copy link
Copy Markdown
Collaborator

Summary

  • log before/after token estimates on buzz-agent handoffs
  • reuse the projected handoff-token helper for both gating and logging
  • cover the handoff log shape in the token-gate regression test

Notes

The post-handoff prompt path is in crates/buzz-agent/src/handoff.rs: HANDOFF_SYSTEM_PROMPT asks the summarizer to produce a context handoff summary, then maybe_handoff injects [Context Handoff]\n{summary} plus optional [Post-compact hook output — untrusted] into fresh history and re-adds the current user prompt before the next normal completion.

Tests

  • . ./bin/activate-hermit && bin/cargo fmt --check -p buzz-agent
  • . ./bin/activate-hermit && bin/cargo test -p buzz-agent --test regressions handoff -- --nocapture
  • . ./bin/activate-hermit && bin/cargo test -p buzz-agent
  • Push pre-push hook ran broader suite but failed in unrelated rust-tests because hook used rustc 1.89.0 while sqlx@0.9.0 requires rustc 1.94.0; current Hermit shell reports rustc 1.95.0 and targeted buzz-agent tests pass.

@tlongwell-block tlongwell-block requested a review from a team as a code owner July 16, 2026 14:18
Co-authored-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co>
@tlongwell-block tlongwell-block force-pushed the wren/handoff-token-log branch from 1a78216 to 91eaa89 Compare July 16, 2026 15:39
@tlongwell-block tlongwell-block merged commit ca8324d into main Jul 16, 2026
32 checks passed
@tlongwell-block tlongwell-block deleted the wren/handoff-token-log branch July 16, 2026 15:59
tlongwell-block pushed a commit that referenced this pull request Jul 16, 2026
* origin/main: (29 commits)
  chore(release): release Buzz Mobile version 0.4.5 (#1965)
  fix(mobile): support open pairing relays (#1939)
  feat(desktop): refine Projects navigation and overview hierarchy (#1956)
  Log handoff token counts (#1954)
  fix(onboarding): add Welcome finalize skip escape hatch (#1960)
  Welcome channel: Browse channels card, browser sorting, shortcut hint placement (#1948)
  chore(release): release Buzz Desktop version 0.4.7 (#1955)
  feat(desktop): confirm invites with an Opening-invite loading gate before machine onboarding (#1950)
  fix(mobile): replace pairing placeholder with Buzz icon (#1952)
  feat(desktop): remove theme selection from onboarding, default to Buzz + System (#1947)
  fix(desktop): sentence-case runtime descriptions in onboarding setup (#1944)
  feat(desktop): Projects v3 — overview redesign, activity feed, agent access & sync controls (#1851)
  Rework first-launch community onboarding (#1936)
  fix(desktop): stop marking users away while active on the machine (#1942)
  Add pre-push branch-skew guard and changed-spec e2e recipe (#1940)
  ci: build the relay once and cache it by source hash (#1941)
  fix(desktop): variant-aware connecting gate for first-run handoffs (#1938)
  Redesign agent AI configuration and defaults (#1935)
  Add Buzz-managed Node runtime for agent installs (#1930)
  feat(desktop): return nostr binding proof in browser fragment (#1933)
  ...

# Conflicts:
#	desktop/src/features/communities/ui/AddCommunityDialog.tsx
#	desktop/src/features/communities/ui/WelcomeSetup.tsx
#	desktop/src/features/onboarding/ui/MembershipDenied.tsx
#	desktop/src/shared/deep-link.ts
#	desktop/tests/e2e/onboarding.spec.ts
tlongwell-block pushed a commit that referenced this pull request Jul 16, 2026
* origin/main: (29 commits)
  chore(release): release Buzz Mobile version 0.4.5 (#1965)
  fix(mobile): support open pairing relays (#1939)
  feat(desktop): refine Projects navigation and overview hierarchy (#1956)
  Log handoff token counts (#1954)
  fix(onboarding): add Welcome finalize skip escape hatch (#1960)
  Welcome channel: Browse channels card, browser sorting, shortcut hint placement (#1948)
  chore(release): release Buzz Desktop version 0.4.7 (#1955)
  feat(desktop): confirm invites with an Opening-invite loading gate before machine onboarding (#1950)
  fix(mobile): replace pairing placeholder with Buzz icon (#1952)
  feat(desktop): remove theme selection from onboarding, default to Buzz + System (#1947)
  fix(desktop): sentence-case runtime descriptions in onboarding setup (#1944)
  feat(desktop): Projects v3 — overview redesign, activity feed, agent access & sync controls (#1851)
  Rework first-launch community onboarding (#1936)
  fix(desktop): stop marking users away while active on the machine (#1942)
  Add pre-push branch-skew guard and changed-spec e2e recipe (#1940)
  ci: build the relay once and cache it by source hash (#1941)
  fix(desktop): variant-aware connecting gate for first-run handoffs (#1938)
  Redesign agent AI configuration and defaults (#1935)
  Add Buzz-managed Node runtime for agent installs (#1930)
  feat(desktop): return nostr binding proof in browser fragment (#1933)
  ...

# Conflicts:
#	desktop/src/features/communities/ui/AddCommunityDialog.tsx
#	desktop/src/features/communities/ui/WelcomeSetup.tsx
#	desktop/src/features/onboarding/ui/MembershipDenied.tsx
#	desktop/src/shared/deep-link.ts
#	desktop/tests/e2e/onboarding.spec.ts

Signed-off-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co>
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.

1 participant