Repository navigation
Conversation
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
3 similar comments
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
bolichen97
left a comment
There was a problem hiding this comment.
Requesting changes: resolved_cwd() imports a loader function that does not exist on this branch
This PR adds resolved_cwd() in src/kiro_crew/config/paths.py. At line 385 it does:
from kiro_crew.config.loader import session_default_cwd
return str(session_default_cwd(session_key))The PR doesn't touch config/loader.py. At this head the loader defines _session_work_dir(session_key) (src/kiro_crew/config/loader.py:528) and has no session_default_cwd. origin/main doesn't have it either. The rename exists only in the open PRs PR #11813, PR #11831 and PR #11722, so rebasing onto main won't fix it.
What breaks
-
CI. Running mypy with the repo's config gives
src/kiro_crew/config/paths.py:385: error: Module "kiro_crew.config.loader" has no attribute "session_default_cwd" [attr-defined].Type check (mypy)(mypy src/kiro_crew/,.github/workflows/ci.yml:576-577) is a blocking step. No workflow has run yet because this is a fork draft, so the failure will appear once the PR leaves draft. If the PR merged like this, Backend Lint & Type Check would fail on main for every later PR. -
Runtime.
resolved_cwd("", "dashboard:x")raisesImportError: cannot import name 'session_default_cwd' from 'kiro_crew.config.loader'(reproduced). Every cleared-project path this PR adds goes through that call:SessionManager.resolve_arm_cwd(src/kiro_crew/session.py:1661)note_project_change("")(src/kiro_crew/session.py:1716)_record_arm_cwd(src/kiro_crew/session_allocation.py:570)transfer_retire_arm(src/kiro_crew/session_allocation.py:647)_reacquire_and_validatewithcwd=""(src/kiro_crew/session_allocation.py:882)
At this head nothing sets
slot.project_cleared = True, so production can't reach any of these yet. PR #11910 sets that marker and carries the samepaths.pywithout the rename. If it lands before the rename, every turn on a cleared slot will raise this ImportError.
The new tests don't catch this. test/test_chat_slot_unsettled_reset.py replaces state.sessions with a MagicMock and stubs resolve_arm_cwd, so the real resolved_cwd("") never runs.
Smallest fix: there are two options. Carry the _session_work_dir -> session_default_cwd rename into config/loader.py here, as the sibling PRs do. Or have resolved_cwd call _session_work_dir until the rename lands. Either way, a test that calls resolved_cwd("", key) with no mocks would keep the import from breaking again.
From a full open-PR audit against origin/main c66f95b (2026-09-25); findings were checked by independent reviewers reading the code. Reply here if this is wrong.
|
Consolidation: the PR #11831 has the same author and is at head
What #11831 has that this branch lacks
What only this branch has
Suggestion: land this fix through #11831. Port the test file there: it only needs From a full open-PR audit against origin/main c66f95b (2026-09-25); findings were checked by independent reviewers reading the code. Reply here if this is wrong. |
A rebind landing inside the settle's own region is parked, so the settled key never moves and only the unsettled report can catch it -- re-arm instead.
6a8a97c to
fdfc50e
Compare
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
10 similar comments
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
Triage update (origin/main I checked the current head against main and the open sibling PRs.
I agree with the earlier consolidation suggestion. Port the test file into #11831, and decide Automated open-PR triage, 2026-10-05. Reply here if this is wrong. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
1 similar comment
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
Closing this draft as part of a stale-PR cleanup: it has had no activity for 14+ days. Nothing is lost: the branch stays, and you can reopen this PR anytime (or open a fresh one rebased on main). Thanks for the work here! |
Problem / Motivation
A deferred reset is consumed on the assumption that the key it was armed against is the
key the session now holds. A rebind that arrives inside the settle's own region is
parked rather than applied, so the settled key never moves — and the caller, seeing no
key change, treats the reset as delivered and clears the flag. The reset is then owed to
a binding nobody is on: the live key keeps the stale session for the rest of its life.
The settle is the only place this can happen, because it is the one window where a key is
resolved and then published as two separate steps.
Why it matters
The failure is silent and it does not self-heal. The flag is cleared, so nothing retries;
the session that should have been reset keeps serving the live key, carrying whatever
state the reset existed to discard. Because the observable symptom is "the key did not
change" — which is also the normal outcome of a parked rebind — the caller has no way to
tell a delivered reset from one that was dropped.
What changed
_consume_pending_resetno longer treats an unchanged key as proof of delivery. When thetransfer reports the arm unsettled, the reset is re-armed rather than cleared, so the
next turn retries against the key that actually landed.
The slot-allocation core, the arm verbs and the cleared-cwd marker are carried here
identically to their siblings so this change compiles and tests on its own.
Also folded in, because the carried call site forces it:
_consume_pending_resetpassesrefuse_only_on_active_turn=True, which narrowsskip_if_busyto a declared turn so amere lifetime lease cannot refuse a reset the user asked for. Three existing assertions
pinned the old signature and are updated to the new one.
Tests
Two added cases in
test/test_chat_slot_unsettled_reset.py:stopped consuming resets would fail here.
Break-armed: with the
arm_settledclause removed from the guard, the reproduction failswhile the positive control still passes.
Full suite run against a pristine same-base control on an idle host: zero new
failures, identical failing-id sets in both directions apart from one item in
test_session.py::TestCleanupLoopResilience, which flips on the control side and is aTimeoutErrorrather than an assertion (314 passed across eight runs on both trees).