Repository navigation
Conversation
4c4bf14 to
77293c3
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. |
|
👋 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. |
5 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. |
bolichen97
left a comment
There was a problem hiding this comment.
Windows-visible runtime issue at head 77293c3178:
The new empty-cwd branch in config.paths.resolved_cwd imports session_default_cwd from config.loader, but that symbol is absent from this head. Clearing a project or resolving the default cwd therefore raises during session reuse/rebinding on Windows and other platforms.
Please include the intended implementation or route through the existing default-cwd owner, and add an unmocked resolved_cwd("") test.
|
PR triage (automated, head P0, following up @bolichen97's review: this breaks every workspace switch, not only clears.
What breaks:
The tests pass because every fixture replaces Rebase: this head conflicts with Merge discussion: this PR carries identical copies of the arm core ( |
|
👋 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.
[P0] Workspace switch and project clear always fail with 503: resolved_cwd imports a nonexistent loader symbol
Mechanism: POST workspace switch -> chat_handlers.py:9215 state.sessions.resolve_arm_cwd(session_key, CWD_CLEARED='') -> session.py:1657 asyncio.to_thread(resolved_cwd, '', key) -> config/paths.py:385 'from kiro_crew.config.loader import session_default_cwd' -> ImportError -> caught at chat_handlers.py:9216 -> 503 workspace_unavailable. Project clear/set reaches the same resolve at chat_handlers.py:9531; session_allocation.py:569/646 also call resolved_cwd(cwd, key) with a cleared cwd.
User impact: Every dashboard user: no workspace switch can succeed (always 503 'configured workspace directory is unavailable'), and the project handler's cleared-arm resolve fails the same way; any other cleared-project arm path (chat_runner.py:866, session_allocation arm) raises too.
Location: src/kiro_crew/config/paths.py:385 @ 77293c31784ad27d909f99112de02af1b70c0e5c
Minimum fix: Import the existing per-session default resolver (main's kiro_crew.config.loader._session_work_dir, or add a public session_default_cwd to loader that wraps it) in resolved_cwd, and add one unmocked test.
How to verify: Unmocked test: resolved_cwd('', 'dashboard:x') returns workspace_root()/ (fails now with ImportError); plus a workspace-switch handler test that uses the real SessionManager.resolve_arm_cwd and asserts 200, not 503.
Independently re-verified on head 77293c3178.
| ) | ||
| # Deferred: this module is a LEAF by design (see the module docstring) and | ||
| # ``config.loader`` imports it at module load, so a top-level import cycles. | ||
| from kiro_crew.config.loader import session_default_cwd |
There was a problem hiding this comment.
[P0] Workspace switch and project clear always fail with 503: resolved_cwd imports a nonexistent loader symbol — see the review summary for mechanism, fix and test.
A rebind parked inside the settle leaves the observed key unmoved, so the caller published a workspace or project with no arm raised to carry it.
77293c3 to
cbae1e7
Compare
|
Closing this draft as part of stale-PR cleanup: it has had no activity for 14+ days. Nothing is lost. The branch stays, and you can reopen this PR (or open a fresh one rebased on main) whenever you pick it up again. Thanks for the work. |
Problem / Motivation
Goal: a workspace or project switch that cannot settle its arm on the key that actually landed answers 409
session_reboundand leaves the slot unchanged, instead of publishing a binding nothing carries.A slot's workspace and project switches resolve which session key the change should land
on behind an
await. A rebind arriving inside that window is parked rather than applied,so the key the resolve observed never moves and it reports the arm unsettled.
A caller that publishes anyway leaves a workspace or project visible on the slot with no
arm raised to carry it. The next cwd-less claim then binds the directory the slot is
leaving, so every relative write in that turn lands in the wrong project.
Why it matters
The switch answers 200 and the UI shows the new project, so nothing signals that the
binding was never armed. The damage surfaces one turn later and somewhere else — a file
written to the previous project — with no trace connecting it to the switch that caused it.
The cleared case is worse than the unset one. Restoring an empty path without the
cleared marker makes a deliberately-cleared slot read as never-set, and the stored-cwd
resume override then restores the very project the user just cleared.
Not a goal
What changed
Both handlers now branch on whether the arm settled:
commits;
pending reset key), marks the slot dirty and answers 409
session_rebound, so thecaller retries against the current binding.
_settle_arm_targetis the single place that resolves an arm target and reports whether itsettled, and it retracts the source arm when it does not.
The slot-allocation core, the arm verbs and the cleared-cwd marker are carried here
identically to their siblings (#11813, #11831, #11910, #11983) so this change compiles and
tests on its own.
Tests
Three added cases in
test/test_chat_slot_unsettled_publish.py:One existing test is replaced rather than deleted: the rebind-during-save case previously
pinned a rollback, but rolling back is the wrong remedy there — the save awaits after the
arm, so the correct behaviour is to transfer the arm to the live key and commit. It is
renamed to
test_rebind_during_the_save_transfers_the_arm_to_the_live_keyand now assertsthe transfer. It is also the positive control for the branch the three added cases do not
reach.
Break-armed in both directions:
arm_settledguard from the workspace handler fails the workspace casewhile both project cases still pass;
passes;
pass.
Several existing fixtures mock
resolve_arm_cwdsynchronously; it is awaited here, sothey are updated to
AsyncMockat the shared state builders rather than per test.Full suite (110k tests) against a pristine same-base control, both runs launched together
on the same host: zero new failures. The single asymmetry is one item in
test_session.py::TestCleanupLoopResilience, in a file this change does not touch — itpasses 2/2 across four runs on each tree and flips under parallel load only.