fix(driver): an unloaded mode downgrades instead of hanging the dispatch - #51
Merged
Merged
Conversation
review/refactor/devsecops are not Bob built-ins — 2.0.3 ships agent/plan/ask — they come from the workspace's .bob/custom_modes.yaml that init-project-board.mjs installs. In a project without that file the slug does not resolve, and Bob reports that by doing nothing: startTask -> handleInputMessage posts "Invalid mode used." to the webview and returns, after openTask has already created the task row. The driver correlated a row that never ran, so updated_at never passed created_at, the completion watch never settled, and the dispatch burned its full wall clock to report a bare timeout. Resolve the slug against the workspace's modes before dispatching: on a miss, name the file to add and run the turn in a fallback mode rather than stalling. The fallback keeps the mode's safety profile — a read-only slug lands on ask, the only built-in with no edit group, not on write-capable agent, so a review that lost its custom mode still cannot rewrite the code it was sent to inspect. The comment claiming Bob throws `Mode with id "<x>" not found` on an unknown slug described resolveMode(), which startTask never calls; corrected alongside. Verified against the 2.0.3 bundle and a live store: startTask, the tasks/messages/ task_pending_approvals schema (newest migration is still 010_pending_approvals), the active->running->active lifecycle, and the settings.json auto-approve keys are all unchanged. costs gained a contextTokens field the existing parser ignores.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
review/refactor/devsecopsare not Bob built-ins — 2.0.3 shipsagent/plan/ask. They come from the workspace's.bob/custom_modes.yamlthatinit-project-board.mjsinstalls, so any project without that file resolves none of them.Bob reports an unresolvable slug by doing nothing.
startTask→handleInputMessageposts "Invalid mode used." to the webview and returns — afteropenTaskhas already created the task row. The driver therefore correlated a row that never ran:updated_atnever passedcreated_at,hasRun()stayed false, the completion watch never settled, and the dispatch burned its full wall clock to report a baretimeoutwith no error text.The symptom reads as a slow Bob, not a misconfigured workspace, so it can cost a whole dispatch timeout before anyone suspects the mode. As of today only 2 of the 12 checkouts under
C:\vsPounceProjectcarry the modes file.Change
Resolve the slug against what the workspace can actually load — 2.0.3's built-ins plus the slugs declared in the workspace and global
custom_modes.yaml— before callingstartTask. On a miss: print which file to add and dispatch in a fallback mode. Non-blocking by design; a missing mode never fails the dispatch.The fallback is keyed on the safety profile rather than always landing on
agent: a read-only slug goes toask, the only built-in with noeditgroup. Sending an unresolvablereviewtoagentwould hand a read-only review write access to the code it was asked to inspect — a silent capability upgrade at exactly the moment the config is already wrong. The tradeoff is thataskhas noexecuteeither, so a degraded review can't rungit diff: weaker, but weak in the safe direction, and the warning says how to restore the real mode.Slugs are scraped rather than parsed — only the slug matters and the repo carries no YAML dependency, matching the same call in
init-project-board.mjs. Over-reporting is the safe direction: a slug wrongly accepted just restores today's hang, while one wrongly missed would downgrade a working mode.Also corrects a comment stating Bob throws
Mode with id "<x>" not foundon an unknown slug. That isresolveMode(), whichstartTasknever calls.Bob 2.0.3 compatibility
Verified against the 2.0.3 bundle and a live store; no driver changes needed for the upgrade itself:
startTask({content, mode, workspaceFolder, mask})unchanged, still focusesbobChatView010_pending_approvals, sotasks/messages/task_pending_approvalsstill match the store readeractive → running → activelifecycle unchanged, still nocompletedsettings.jsonauto-approve keys unchanged and preserved across the upgradecostsgainedcontextTokens, whichparseCostsignoresLatent, not firing:
approval.forbiddenApprovalGroupsis checked ahead ofallowed_permissionsinshouldAutoApproveand is driven by theDisabledAutoApprovalGroupsGPO policy, whose definition default isedit,execute. No such policy is set on this machine, but if one is ever applied it would silently disable headless edit and execute.Tests
9 new (736 total, all passing): slug scraping from the workspace file, a bare workspace, a null workspace and unparseable YAML, built-ins resolving untouched, custom modes resolving as themselves, the safety-preserving fallback mapping, and driver-level coverage that an unloaded mode warns, downgrades, and still completes while a loadable one dispatches silently.