Skip to content

fix(kanban): admit owner-run tasks as finite turns - #139001

Closed
Wenfengcheng wants to merge 1 commit into
NousResearch:mainfrom
Wenfengcheng:fix/kanban-finite-owner-turns-138992
Closed

Wenfengcheng wants to merge 1 commit into
NousResearch:mainfrom
Wenfengcheng:fix/kanban-finite-owner-turns-138992

Conversation

@Wenfengcheng

@Wenfengcheng Wenfengcheng commented Oct 15, 2026 •

Copy link
Copy Markdown

What does this PR do?

Mark dispatcher-owned kanban.run submissions as finite turns. These headless workers previously lost the chat -q context when execution moved to the profile owner, so approvals could wait for a person who cannot answer.

Reuse the existing admission/worker finite-turn machinery. Do not set unattended (the separate auto-approval grant), change the kanban policy source, or change approval defaults.

Related Issue

Part of #138992. This verifies admission propagation and single-query approval behavior. The report's separate observations about clarify, delegation, Codex shutdown and background review are not independently exercised here yet.

Base: db44c46208f1b421b4ecb7e56bf9d68b0423906f.

Type of Change

  • Bug fix

Changes Made

  • Add finite: True at the trusted Kanban submission boundary.
  • Add regressions reaching real Kanban SQLite claim/marker creation and the in-process finite context.
  • Exercise real session creation, durable admission, retry deduplication, managed-worker bootstrap and worker context. The real approval gate respects both caller-selected single_query_mode: deny and approve without invoking the supplied human callback.

How to Test

scripts/run_tests.sh tests/gateway/test_kanban_finite_admission.py -q

  • Base RED: 2 expected assertion failures (single-query context is false on both the direct and durable worker paths).
  • Focused GREEN: 3 passed, 0 failed on native Windows using the available Python 3.11 test interpreter.
  • git diff --check: passed.

Validation limits: this is a local real-storage integration test, not a full dispatcher/LLM subprocess E2E. The model is never called in the focused tests; scheduling is paused for deterministic admission inspection. Python 3.14, the full suite and blocking scripts/check have not been completed. The available SQLite uses the product's DELETE-journal fallback rather than WAL.

Post-publication affected regression run: 22 passed, 0 failed across six files (finite admission, Kanban claims/off-loop admission/recovery, unattended wire authorization, finite delegation outcomes). The real dispatcher lifecycle was excluded from that count and run separately: its complete case fails with model never reached both on this head and with the sole production change reverted to the base. This establishes a matching baseline failure in the available environment, not a successful live run or a diagnosed root cause. The other four live lifecycle modes were not run. Pinned Ruff 0.15.10 is absent; no dependencies or runtimes were installed. Draft remains pending supported-runtime/live validation.

Scope

Preserve claim authorization, retry identity, Kanban policy/toolsets and existing approval configuration. No new approval mode, unconditional auto-approve, timeout changes, dispatcher redesign, or migration of already-queued admissions.

Checklist

  • Read contribution guidance; conventional commit; searched issue links and semantic PR terms.
  • Narrow changes and baseline RED regression tests.
  • Tested on native Windows.
  • Full test suite passes.
  • python scripts/check passes.
  • Configuration/docs/schema changes: N/A; existing finite-turn contract is reused.

@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/sessions Session lifecycle, resume, persistence, history sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Oct 15, 2026

@unsupportedpastels unsupportedpastels left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Wenfengcheng thanks for this. Closing as superseded by #139274, which is now merged to main and fixes KB-1 (tracked in #134889). Your change landed as 84332997 with a Co-authored-by trailer. #139274 also makes a retry of an attempt admitted before the change replay its committed payload, so it does not hit admission_conflict.

@Wenfengcheng
Wenfengcheng deleted the fix/kanban-finite-owner-turns-138992 branch October 16, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists 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.

3 participants