Skip to content

fix(dashboard): reset model state on agent switch - #9115

Closed
Premshay wants to merge 1 commit into
kirodotdev:mainfrom
Premshay:upstream/dashboard-agent-model-reset
Closed

Premshay wants to merge 1 commit into
kirodotdev:mainfrom
Premshay:upstream/dashboard-agent-model-reset

Conversation

@Premshay

@Premshay Premshay commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Switching a dashboard slot to another agent starts it on that agent's own model configuration, not a model pinned for the previous agent.

Switching a dashboard slot to another agent retained the previous agent's model pin and fallback recovery state. A replacement session could therefore send a model identifier that belongs to the old binding.

Why it matters

The next turn can start with an incompatible model instead of the target agent's default configuration.

Not a goal

  • Clearing the model on provider-reported in-turn agent switches; they keep the active pin.
  • Changing which model an agent defaults to.
  • Syncing model pins between a remote peer and its mirror outside an agent pick.

What changed (motivation → approach → change)

Agent switches already reset their session before the next turn. The transaction now joins the existing model-pick lock and resets the provider's fallback walk when the agent changes — including a name-only pick whose resolved member/template namespace moved — unwinding that reset only while the request still owns the agent. The stored model pin is deliberately kept: a switch rewrites nothing on disk, and the read side already withholds a pin the new agent cannot serve (pin_applies), so the chip keeps what the user picked while the session runs on the backend default. An accepted remote mirror follows the model the peer reports. Switch responses always carry the committed model, so the acting tab shows the pin the slot is on even when the slots rebroadcast cannot arrive. Same-agent resets leave model state unchanged.

Tests

  • Added coverage for clearing and persisting model/fallback state on an agent change.
  • Added coverage for preserving model state on a same-agent reset and restoring it after a pre-pop reset failure.
  • ^[[1m============================= test session starts ==============================^[[0m
    platform linux -- Python 3.14.4, pytest-8.4.2, pluggy-1.6.0
    rootdir: /home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset
    configfile: setup.cfg
    plugins: xdist-3.8.0, cov-6.3.0, timeout-2.4.0, hypothesis-6.165.2, asyncio-1.4.0, testmon-2.2.0
    timeout: 120.0s
    timeout method: signal
    timeout func_only: False
    asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
    created: 13/13 workers
    13 workers [769 items]

^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[33m [ 9%]
^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.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32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[32m.^[[0m^[[33m [100%]^[[0m
^[[33m=============================== warnings summary ===============================^[[0m
../../KiroCrew/.venv/lib/python3.14/site-packages/xdist/plugin.py:289: 14 warnings
/home/prems/dev/repos/premshay/KiroCrew/.venv/lib/python3.14/site-packages/xdist/plugin.py:289: DeprecationWarning: The --looponfail command line argument and looponfailroots config variable are deprecated.
The loop-on-fail feature will be removed in pytest-xdist 4.0.
config.issue_config_time_warning(warning, 2)

test/test_dashboard_chat.py: 263 warnings
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/test/chat_test_helpers.py:231: NotAppKeyWarning: It is recommended to use web.AppKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
app["state"] = state

test/test_dashboard_chat.py: 13 warnings
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/test/chat_test_helpers.py:225: NotAppKeyWarning: It is recommended to use web.RequestKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#request-s-storage
request["app"] = "" # dashboard user, not an app

test/test_dashboard_chat.py: 13 warnings
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/test/chat_test_helpers.py:227: NotAppKeyWarning: It is recommended to use web.RequestKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#request-s-storage
request["user"] = "local-app" # recognized as owner

test/test_dashboard_chat.py: 96 warnings
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/src/kiro_crew/dashboard/chat_runner.py:2127: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
report = _session_mcp_report(provider)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py: 71 warnings
/home/prems/dev/repos/premshay/KiroCrew/.venv/lib/python3.14/site-packages/_pytest/stash.py:108: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
del self._storage[key]
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py: 26 warnings
/usr/lib/python3.14/unittest/mock.py:2259: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
def init(self, name, parent):
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py: 12 warnings
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/src/kiro_crew/dashboard/handlers/usage.py:1049: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
return (int(used_fn()), int(window_fn()))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py: 30 warnings
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/test/chat_test_helpers.py:267: NotAppKeyWarning: It is recommended to use web.AppKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
app["state"] = state

test/test_dashboard_chat.py::TestPythonStageLoop::test_queued_receipt_carries_the_entry_queue_id
/usr/lib/python3.14/contextlib.py:450: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
def exit(self, exctype, excinst, exctb):
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py: 61 warnings
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/test/chat_test_helpers.py:294: NotAppKeyWarning: It is recommended to use web.AppKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
app["state"] = state

test/test_dashboard_chat.py::TestRegenerateAndVariants::test_edit_resend_non_dict_body_is_400_not_500
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/test/test_dashboard_chat.py:13526: NotAppKeyWarning: It is recommended to use web.AppKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
app["state"] = state

test/test_dashboard_chat.py::TestRegenerateAndVariants::test_restore_preserves_variants
test/test_dashboard_chat.py::TestForkSlot::test_fork_copies_all_messages
/usr/lib/python3.14/collections/init.py:455: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
result = tuple_new(cls, iterable)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestForkSlot::test_fork_with_prompt
/usr/lib/python3.14/unittest/mock.py:2608: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
return tuple.new(cls, (name, args, kwargs))
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestForkSlot::test_fork_reads_full_history_from_disk_when_memory_capped
test/test_dashboard_chat.py::TestBulkModelSwitch::test_switches_all_differing_slots_and_resets_each
:2: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestStopReasonCancelled::test_monitor_wake_turn_does_not_write_user_memory
/usr/lib/python3.14/threading.py:290: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
def init(self, lock=None):
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestStopReasonCancelled::test_cancelled_turn_restores_the_reinjection_flag
:53: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestStopReasonCancelled::test_cancelled_turn_restores_the_reinjection_flag
test/test_dashboard_chat.py::TestStopReasonCancelled::test_landed_turn_does_not_restore_the_reinjection_flag
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/src/kiro_crew/dashboard/chat_runner.py:7179: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
model_window = window_for_provider_client(client)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestStopTurnSlotState::test_stop_turn_slot_state_transitions_soft
/usr/lib/python3.14/unittest/mock.py:455: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
if not issubclass(cls, AsyncMockMixin):
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestRunChatTransientRetry::test_first_exhausted_cycle_never_discards
test/test_dashboard_chat.py::TestRunChatTransientRetry::test_canary_empty_reply_is_not_positive_evidence
test/test_dashboard_chat.py::TestRunChatTransientRetry::test_stop_during_canary_vetoes_discard_and_requeue
test/test_dashboard_chat.py::TestRunChatTransientRetry::test_transient_budget_refreshed_after_terminal_error
test/test_dashboard_chat.py::TestRunChatTransientRetry::test_poisoned_discard_is_one_shot_until_a_turn_lands
test/test_dashboard_chat.py::TestRunChatTransientRetry::test_unreadable_session_model_skips_canary_and_discard
test/test_dashboard_chat.py::TestRunChatTransientRetry::test_thinking_only_failures_never_accrue_discard_streak
test/test_dashboard_chat.py::TestRunChatTransientRetry::test_canary_failure_blocks_discard_and_preserves_one_shot
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/src/kiro_crew/llm_helpers.py:610: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
return advertised_model_ids(getter())
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestStopTurnSlotState::test_single_press_empty_queue_goes_idle
/usr/lib/python3.14/unittest/mock.py:460: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
new = type(cls.name, bases, {'doc': cls.doc})
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestRunChatTransientRetry::test_poisoned_conversation_discarded_on_second_exhausted_cycle
/usr/lib/python3.14/unittest/mock.py:430: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
def init(self, /, *args, **kwargs):
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestRunChatTransientRetry::test_poisoned_conversation_discarded_on_second_exhausted_cycle
/usr/lib/python3.14/json/encoder.py:263: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
return _iterencode(o, 0)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestRunChatTransientRetry::test_cancelled_turn_does_not_rearm_poisoned_one_shot
/usr/lib/python3.14/ast.py:46: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
return compile(source, filename, mode, flags,
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestRunChatTransientRetry::test_posttoken_suppressed_leaves_allowance_for_later_turn
/usr/lib/python3.14/unittest/mock.py:496: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
dict['_mock_mock_calls'] = _CallList()
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestStopTurnSlotState::test_stop_event_replace_in_place
/usr/lib/python3.14/asyncio/selector_events.py:673: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
def _sock_write_done(self, fd, fut, handle=None):
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

test/test_dashboard_chat.py::TestBulkModelSwitch::test_switches_all_differing_slots_and_resets_each
test/test_dashboard_chat.py::TestBulkModelSwitch::test_already_on_target_is_unchanged_not_reset
test/test_dashboard_chat.py::TestBulkModelSwitch::test_reset_failure_is_isolated_and_reported
test/test_dashboard_chat.py::TestBulkModelSwitch::test_skips_running_slot_by_default
test/test_dashboard_chat.py::TestBulkModelSwitch::test_skip_running_false_forces_running_slot
test/test_dashboard_chat.py::TestBulkModelSwitch::test_app_caller_only_switches_own_slots
test/test_dashboard_chat.py::TestBulkModelSwitch::test_non_boolean_skip_running_is_rejected
test/test_dashboard_chat.py::TestBulkModelSwitch::test_canonical_key_rejected_no_slot_touched
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/test/test_dashboard_chat.py:19088: NotAppKeyWarning: It is recommended to use web.AppKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
app["state"] = state

test/test_dashboard_chat.py::TestSlotsGetWarmsGitLabAllowlist::test_cold_get_returns_the_authorized_self_hosted_link
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/test/test_dashboard_chat.py:19007: NotAppKeyWarning: It is recommended to use web.AppKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
app["state"] = state

test/test_dashboard_chat.py::TestSlotModelGuard::test_canonical_key_rejected_slot_unchanged
test/test_dashboard_chat.py::TestSlotModelGuard::test_valid_kiro_alias_is_allowed
test/test_dashboard_chat.py::TestSlotModelGuard::test_auto_literal_is_allowed
test/test_dashboard_chat.py::TestSlotModelGuard::test_empty_string_auto_default_is_allowed
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/test/test_dashboard_chat.py:19323: NotAppKeyWarning: It is recommended to use web.AppKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
app["state"] = state

test/test_dashboard_chat.py: 25 warnings
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/test/test_dashboard_chat.py:19406: NotAppKeyWarning: It is recommended to use web.AppKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
app["state"] = state

test/test_dashboard_chat.py::TestBulkModelSwitch::test_falsy_non_string_marker_fails_closed
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/test/test_dashboard_chat.py:19270: NotAppKeyWarning: It is recommended to use web.AppKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
app_obj["state"] = state

test/test_dashboard_chat.py::TestBulkModelSwitch::test_missing_auth_marker_is_denied
/home/prems/dev/repos/premshay/.worktrees/kc-upstream-dashboard-agent-model-reset/test/test_dashboard_chat.py:19243: NotAppKeyWarning: It is recommended to use web.AppKey instances for keys.
https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config
bare_app["state"] = state

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================= slowest 5 durations ==============================
1.00s call test/test_dashboard_chat.py::TestOrchestratorPlanGateArming::test_stage_loop_times_out_a_stage_that_swallows_cancellation
0.45s call test/test_dashboard_chat.py::TestFullPaginationWalk::test_walk_all_pages
0.39s call test/test_dashboard_chat.py::TestSlotModelLiveSwitch::test_refused_pick_rollback_spares_a_newer_concurrent_pick
0.39s call test/test_dashboard_chat.py::TestSlotModelLiveSwitch::test_two_refused_picks_leave_the_slot_untouched
0.38s call test/test_dashboard_chat.py::TestResumeDedupe::test_resume_from_disk_sends_the_older_history_cursor
^[[33m====================== ^[[32m769 passed^[[0m, ^[[33m^[[1m665 warnings^[[0m^[[33m in 10.78s^[[0m^[[33m ======================^[[0m — 769 passed.

  • Black, isort, flake8, diff validation, and documentation lint passed.

Manual verification

N/A — handler transaction, persistence, and rollback paths are covered by the dashboard suite.

Related Issues

N/A — identified during reconciliation of the fork's portable dashboard fixes.

Pattern harvest

Rule candidate: review-prompt

Pattern: Any binding switch that retains provider-specific state must clear or revalidate that state before the next provider session starts.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

From https://github.com/kirodotdev/KiroCrew

@Premshay
Premshay requested review from a team and iamwhatever September 6, 2026 20:18
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — 🟡 CONCERNS

Design-level review of d7676ffe790ec0b600349db536abfb2d6801b2c6 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

The description promises things the diff doesn't do: the model-pick lock, committed model in switch responses, and remote-mirror model following have no code. The Goal also says the old pin is dropped, but the diff keeps it.

Watch

  • The Goal's claim about the pin conflicts with the code. The Goal says a switched slot starts "not [on] a model pinned for the previous agent". The diff does the opposite: "The stored pin is deliberately kept… the read side already withholds a pin the new agent cannot serve (pin_applies)". model_scope.pin_applies only withholds a pin when it is outside the new agent's namespace. So if you switch between two agents on the same harness, the next session still sends the previous agent's pin, and the stated goal is met only for cross-namespace switches.
    Clears when: either the pin is actually cleared on an agent change, or the PR shows that keeping it is intended for same-namespace switches, with a test that switches between same-harness agents.
  • Three described behaviours have no backing code. The description says "the transaction now joins the existing model-pick lock", that switch responses "always carry the committed model", and that "an accepted remote mirror follows the model the peer reports". None of these appear in the patch. api_chat_slot_agent still takes only _slot_switch_session_lock (chat_handlers.py:5122), never slot._model_pick_lock, yet it now writes fallback fields that model_fallback.py treats as owned by the pick lock. The session lock does serialize this write against the dashboard fallback swap, which holds both locks.
    Clears when: the code for each claim is added, or the claims are removed from the description and the lock-ownership note in model_fallback.py is updated to list the agent switch as a writer under the session lock.

[DESIGN-REVIEWED] d7676ff

Description read

[DESCRIPTION-READ] 7a213a77a67837438df13be5d04e9649ed8758d01c5748d836389bc682465a33

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed d7676ffe790ec0b600349db536abfb2d6801b2c6 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d7676ff

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed d7676ffe790ec0b600349db536abfb2d6801b2c6 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] d7676ff

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — 🟡 CONCERNS

Premise-level review of d7676ffe790ec0b600349db536abfb2d6801b2c6 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The Goal promises the new agent's "own model configuration", but the diff keeps the old pin and resets only the fallback walk. Three changes the description lists aren't in the diff.

Not justified as shipped

  • Item 1 — symptom-level: the Goal says a switched slot should not keep "a model pinned for the previous agent", but the diff says "The pin is deliberately kept" and leans on pin_applies (model_scope.py:91). That function scopes a pin by harness namespace, not by agent, so switching between two agents on the same harness still sends the old agent's pin.
    Clears when: the description says this fix covers only the fallback walk, and that the pin carries over between agents on one harness.
  • Item 3 — duplicate of dashboard/chat_turn/model_fallback.py:301 _clear_fallback_sticky_state: that helper already clears 3 of the 6 fields the new helper clears. The new public clear_slot_model_binding has 1 consumer (grepped call sites: 1), and its name says "model binding" while its docstring says "the pin itself is kept".
    Subtraction: delete the public helper. Reuse _clear_fallback_sticky_state and add the index and generation resets inline in api_chat_slot_agent.
    Clears when: the helper is removed, or a second consumer is counted.
  • Item 5 — undeclared: the description says the switch "now joins the existing model-pick lock", that "an accepted remote mirror follows the model the peer reports", and that "switch responses always carry the committed model". None of these hunks is in the diff.
    Clears when: the description matches the diff.

What this change ships

Inventory (5 items) — 2 justified

Intent: a dashboard slot switched to another agent should not start on the previous agent's model state. FIX.

  1. Switching agent (by name, or member/template kind) resets the fallback-recovery walk — symptom-level: the pin is still carried over
  2. A refused switch (409/500) restores the walk it reset — justified
  3. New public clear_slot_model_binding — duplicate of model_fallback._clear_fallback_sticky_state
  4. Test pins that an in-turn switch reported by the provider keeps the pin — justified
  5. Description lists a lock, mirror sync and response changes that aren't in the diff — undeclared

[FIRST-PRINCIPLES-REVIEWED] d7676ff

Description read

[DESCRIPTION-READ] 319199796ae1ef3cd75ae6a3f08b72538627dc3d7a88fad2ae7f8cc269c1d8c6

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 6, 2026
@Premshay
Premshay force-pushed the upstream/dashboard-agent-model-reset branch from 9f946b2 to f481b70 Compare September 7, 2026 09:17
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 7, 2026
@bolichen97
bolichen97 force-pushed the upstream/dashboard-agent-model-reset branch from f481b70 to c9ce307 Compare September 8, 2026 10:11
@bolichen97

Copy link
Copy Markdown
Contributor

Rebased onto main 6fbb06bc by a maintainer as part of the 2026-09-08 open-PR audit (the branch was ~108 commits behind).

Conflicts: clean rebase, no manual resolution. The full diff is unchanged in intent (4 files, +211/-11).

Gates run locally on the changed files: black --check, isort --check-only, flake8 all clean; pytest test/test_dashboard_chat.py::TestRuntimeWiring test/test_remote_crew_execution.py::TestRemotePickApplication.

One pre-existing issue, not caused by the rebase: the two new tests in test/test_remote_crew_execution.py (test_an_agent_change_clears_and_persists_provider_bound_state, test_a_same_agent_pick_keeps_provider_bound_state) are missing @pytest.mark.asyncio, so they fail with async def functions are not natively supported and never assert anything. This repo runs pytest-asyncio in strict mode. Please add the marker.

A maintainer push makes the maintainer the last pusher, so a second approver is needed under this repo's last-push rule. Please review the rebase and reply if anything looks wrong.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 8, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 8, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Sep 18, 2026
@Premshay
Premshay force-pushed the upstream/dashboard-agent-model-reset branch from 037525b to 0fb5fad Compare September 22, 2026 09:31
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 22, 2026
@Premshay
Premshay force-pushed the upstream/dashboard-agent-model-reset branch from 0fb5fad to d1a1431 Compare September 22, 2026 12:22
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 22, 2026
@Premshay
Premshay force-pushed the upstream/dashboard-agent-model-reset branch from d1a1431 to 9c4e2ad Compare September 22, 2026 21:18
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 22, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision d7676ffe790ec0b600349db536abfb2d6801b2c6 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@Premshay

Premshay commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Verified the built SPA at current head c1573f7 in Chromium using the repository gateway-free fixture helpers. I opened the real agent picker and selected reviewer; the mocked successful agent endpoint returned model="". The rendered model chip changed from the pinned claude-opus-5 to auto, and the agent chip changed to reviewer. Both screenshots were visually inspected and have different SHA-256 hashes. This confirms the frontend renders the response; it does not exercise a real provider reset. Production build passed.

The UX concern about the reset being silent remains valid: there is no separate reset notice in this flow. I have not changed the reset policy, added a notice, or marked that concern resolved. The coupled-switch simplification and documentation suggestions also remain open.

@Premshay

Premshay commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the reset-feedback and coupled-switch concerns in aba50b1 (previous head c1573f7).

A committed agent response that clears an explicit model pin now uses the existing shared notice: “Model reset to auto for .” No notice is emitted for auto/empty pins, refusals, retained pins, or older gateways that omit model state. The reset policy is unchanged. Agent/model ordering is now an explicit pair, without the configurable extra-settlements callback. The owning session spec documents both behaviors.

Verification: 57 focused switch/feedback/host tests passed; TypeScript, production build, focused ESLint, all 19 i18n checks with the previous head supplied as base, docs lint, Black/subprocess-encoding gates, isort and flake8 passed. Full mypy reports only cli.py:465 asyncio.PidfdChildWatcher under Python 3.14, already reproduced on clean base; that file is byte-identical between this branch's base and the tested clean base. This is not a claim of a complete local-gate pass.

I clicked the actual agent picker in the built SPA with gateway-free API fixtures and visually verified both the auto chip and the reset notice. The capture SHA-256 is 25151748195551dac8f0380c1cd13e6bc05c397e2290544aca834c03ab5f1adb. This proves rendering of the successful response, not a real provider reset.

Copy link
Copy Markdown
Contributor

Open-PR triage (2026-10-05). Checked head aa2e1e3 against origin/main af1eb612.

Status: needs a rebase. The branch is 118 commits behind main and GitHub reports mergeable_state: dirty. Main still has none of this change: there is no clear_slot_model_binding, api_chat_slot_agent does not take _model_pick_lock, and the agent-switch response has no model key. So this PR is not superseded.

The keep-or-clear contract is still split at this head, and its own tests fail. I ran pytest test/test_remote_crew_execution.py test/test_chat_slot_switch_atomicity.py test/test_dashboard_chat.py test/test_acp_tool_identity.py on aa2e1e3. Result: 1187 passed, 2 failed:

  • TestRemotePickApplication::test_an_agent_change_clears_and_persists_provider_bound_state: assert 'old-provider-model' == ''
  • TestRemotePickApplication::test_a_reported_model_change_clears_even_when_the_agent_name_holds: assert 'peer-model' == ''

The cause is clear_slot_model_binding, which resets only the fallback walk ("the pin itself is kept"). The remote tests, the session.md addition ("clear the model pin … through clear_slot_model_binding") and the modelReset notice all assume the pin is cleared. The Design / First-Principles BLOCK and the Opus finding at chat_handlers.py:5147 already raise this, so I am not adding a separate change request. Please pick one contract and make the helper, spec, frontend notice and both test files agree.

Overlaps to coordinate (merge discussion, not duplicates):

No breaking change and no P0 found. Recommendation: rebase, settle the contract, then continue.

Reset provider-scoped fallback state when the resolved agent name or namespace changes. Preserve the stored model pin and restore the prior walk on refusal only while this transaction still owns the reset.

Rebase onto current upstream main without restoring its deleted remote-pick path or obsolete remote tests. Remove the unused frontend model response handoff.
@iamwhatever

Copy link
Copy Markdown
Contributor

Thank you @Premshay for this fix and the thorough tests! Your commit has been carried over to #19729 on a main-repo branch, rebased onto current main with your authorship kept in the git history (plus a Co-authored-by trailer). It is green there and tracked by #19725. Closing this one in favour of #19729; your branch is left untouched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants