Skip to content

fix(kanban): preserve creator chat scope for terminal wakes - #69391

Closed
worlldz wants to merge 1 commit into
NousResearch:mainfrom
worlldz:fix-kanban-chat-scope
Closed

fix(kanban): preserve creator chat scope for terminal wakes#69391
worlldz wants to merge 1 commit into
NousResearch:mainfrom
worlldz:fix-kanban-chat-scope

Conversation

@worlldz

@worlldz worlldz commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #68874
Related to #56580

When a task is created from a direct message, the Kanban notifier can later wake the agent using a different session scope.

The notification itself reaches the correct chat, but the synthetic wake event was rebuilt with chat_type="group". DM and group conversations use different session keys, so the continuation could land in a fresh group session instead of the DM session that created the task.

This change:

  • Persists the creator's chat_type on Kanban notification subscriptions.
  • Adds a backward-compatible SQLite migration for existing databases.
  • Carries chat_type through the session context bridge.
  • Captures the source scope from /kanban create.
  • Covers the tool auto-subscribe path as well.
  • Uses the stored scope when rebuilding notifier wake events.
  • Keeps the historical group fallback for legacy subscriptions.
  • Avoids overwriting an already-captured chat scope.

Regression coverage includes DM wake routing, legacy database migration, chat type normalization, re-subscription behavior, and tool auto-subscription.

Validation:

162 passed

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/cron Cron scheduler and job management area/billing Account usage, credit usage, billing (cross-cutting) sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades needs-decision Awaiting maintainer decision before any implementation labels Jul 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #68879 and #64113: all repair the persisted creator chat_type wake path. This version additionally covers tool auto-subscribe, so this is a competing broader implementation rather than a duplicate; please consolidate the preferred current patch.

@teknium1

Copy link
Copy Markdown
Contributor

Superseded by PR #72191, which fixes this bug via #58615 (@ljsdut, earliest submission) plus the CLI call-site half of #64113 (@zmlgit). Your PR converged on the same design all four competing fixes landed on — chat_type persistence, group fallback, self-heal backfill — which is good corroboration that the design was right; it lost the arbitration only on submission date and auto-subscribe-path coverage. Thanks for the work, and the tests were solid.

@teknium1 teknium1 closed this Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/billing Account usage, credit usage, billing (cross-cutting) comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery needs-decision Awaiting maintainer decision before any implementation P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Kanban terminal wakeups use the wrong session scope for DM subscriptions

3 participants