Skip to content

fix: subscribe to session-scoped channel - #40

Merged
four-bytes-robby merged 1 commit into
mainfrom
fix/session-scoped-subscribe
Jun 14, 2026
Merged

fix: subscribe to session-scoped channel#40
four-bytes-robby merged 1 commit into
mainfrom
fix/session-scoped-subscribe

Conversation

@four-bytes-robby

@four-bytes-robby four-bytes-robby commented Jun 14, 2026

Copy link
Copy Markdown
Member

Uses tbg/{sessionID}/status instead of wildcard tbg/+/status to prevent cross-session token jumping.

  • TokenMeterView accepts session_id: string prop
  • Subscribe channel is now tbg/${session_id}/status (session-scoped)
  • sidebar_content slot wires props.session_id through to the view

Summary by cubic

Scope the token meter subscription to the active session to prevent cross-session token updates. Subscribes to tbg/${session_id}/status instead of tbg/+/status.

  • Bug Fixes
    • TokenMeterView accepts session_id and uses it for the subscribe channel.
    • sidebar_content forwards props.session_id to TokenMeterView.

Written for commit 999fdaf. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Fixed token meter view to display session-specific data instead of aggregated data from all sessions, ensuring accurate per-session monitoring.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

Recent review info
Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4d562cb3-02ed-44de-9300-ad4d78a6768f

Commits

Reviewing files that changed from the base of the PR and between 4ba9e26 and 999fdaf.

Files selected for processing (1)
  • src/tui.tsx

Walkthrough

Walkthrough

TokenMeterView and the sidebar_content slot handler in src/tui.tsx are updated to accept and forward a session_id prop. The BusTui subscription topic is narrowed from the wildcard tbg/+/status to the session-specific tbg/${props.session_id}/status.

Changes

Session-scoped TUI subscription

Layer / File(s) Summary
Session-scoped slot handler and BusTui topic
src/tui.tsx
sidebar_content changes its second argument from an untyped placeholder to { session_id: string } and passes the value to TokenMeterView. TokenMeterView gains a matching props: { session_id: string } parameter and uses it to replace the wildcard subscription topic tbg/+/status with tbg/${props.session_id}/status.

Estimated code review effort

2 (Simple) | ~5 minutes

Possibly related issues

Finishing Touches
Generate docstrings
  • Create stacked PR
  • Commit on current branch
Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/session-scoped-subscribe
Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/session-scoped-subscribe

Comment @coderabbitai help to get the list of available commands and usage tips.

@four-bytes-robby
four-bytes-robby merged commit da91fea into main Jun 14, 2026
2 of 3 checks passed
@four-bytes-robby
four-bytes-robby deleted the fix/session-scoped-subscribe branch June 14, 2026 11:47
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