Skip to content

feat(session-ingest): gate remote session pushes by user#4639

Merged
eshurakov merged 1 commit into
mainfrom
session/agent_f042bc43-88fc-4601-b62d-6bd2cb9922de
Jul 20, 2026
Merged

feat(session-ingest): gate remote session pushes by user#4639
eshurakov merged 1 commit into
mainfrom
session/agent_f042bc43-88fc-4601-b62d-6bd2cb9922de

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

  • replace the disabled remote-session attention push flag with an exact single-user rollout gate
  • forward the optional REMOTE_SESSION_ATTENTION_PUSH_USER_ID through queued and direct ingest dispatches
  • document the setting and cover disabled, non-selected, and selected-user behavior

Validation

  • pnpm exec vitest run src/remote-session-notifications.test.ts
  • pnpm run typecheck
  • pnpm run lint
  • pnpm -w exec oxfmt --check changed files
  • pnpm run test (498 passed; one existing R2-offload route test timed out at 5 seconds)

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@kilo-code-bot

kilo-code-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The rollout gate correctly replaces the disabled flag with an exact single-user-ID comparison, is consistently threaded through both the direct-ingest and queue-consumer dispatch paths, and is covered by tests for the disabled, non-matching, and matching-user cases.

Files Reviewed (8 files)
  • services/session-ingest/.dev.vars.example
  • services/session-ingest/src/env.ts
  • services/session-ingest/src/ingest/direct-ingest.ts
  • services/session-ingest/src/queue-consumer.ts
  • services/session-ingest/src/remote-session-notifications.test.ts
  • services/session-ingest/src/remote-session-notifications.ts
  • services/session-ingest/worker-configuration.d.ts (generated file, skipped)
  • services/session-ingest/wrangler.jsonc

Reviewed by claude-sonnet-5 · Input: 20 · Output: 3.9K · Cached: 392.6K

Review guidance: REVIEW.md from base branch main

deps: DispatchRemoteSessionAttentionDeps
): Promise<DispatchRemoteSessionAttentionOutcome> {
if (!REMOTE_SESSION_ATTENTION_PUSH_ENABLED) {
if (deps.remoteSessionAttentionPushUserId?.trim() !== params.kiloUserId) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low, Functional: This trims remoteSessionAttentionPushUserId before comparing it to params.kiloUserId, but does not guard against params.kiloUserId being empty. If kiloUserId were ever an empty string and the env var were unset or empty, ''.trim() === '' would be true and the gate would incorrectly pass instead of suppressing. There's no code path today that produces an empty kiloUserId, so this is a defensive gap rather than an active bug. Suggest adding an explicit guard, e.g. if (!params.kiloUserId || deps.remoteSessionAttentionPushUserId?.trim() !== params.kiloUserId), so the empty string case is not incidentally treated as a match.

@eshurakov
eshurakov merged commit 2534be4 into main Jul 20, 2026
15 checks passed
@eshurakov
eshurakov deleted the session/agent_f042bc43-88fc-4601-b62d-6bd2cb9922de branch July 20, 2026 14:45
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.

2 participants