Commits
Marek Vsechovsky committed aa61227ff70
Session 154, Step 5: Implement 'Update remaining credit' button with manual adjustment and FIFO subtraction - AIM-2860 Implement 'Update remaining credit' button with manual adjustment and FIFO subtraction - AIM-2888 Credit tracking dialog not appearing on first Process button click - AIM-2891 Cancel dialog for credit tracking with Zero step cost / Cancel processing options - AIM-2892 Show Unprocessed AI outputs dialog less often (10-minute cooldown) Outcome: Implemented and documented the requested fixes and features for 4 issues. See each issue result for details. Session 154, Step 6: Credit tracking dialog OK → process never starts - AIM-2893 Credit tracking dialog OK → process never starts Outcome: Fixed issue -3489: after confirming the credit-tracking dialog, processing now starts immediately. Two regressions in `dashboard-workflow.js` were corrected: 1. Restored a missing closing `}` in the `warnTokens` helper inside `_compareValidationForCredit` (a JavaScript syntax error that broke the whole file). 2. `_showCreditDialogOrProcess` `onConfirm` now awaits `_saveS4CreditToOutput(...)` before calling `processS4Task(task, true)`, so the credit data is written to disk before `processOutputFiles` re-reads the file for import. Session 154, Step 7: Replace 'No session associated with this task' toast with Error(s) dialog and generic AI prompt - AIM-2893 Replace 'No session associated with this task' toast with Error(s) dialog and generic AI prompt - AIM-2895 Fix Process button requiring multiple clicks before credit dialog opens - AIM-2896 Fix Wf S4 step-4 checklist fourth line showing 'It looks like...' without confirmation button - AIM-2897 Block out-of-order same-session processing in Wf S4 with earlier-steps dialog Outcome: Implemented four S4 fixes in `dashboard-workflow.js`: 1. issue -3490: session-resolution failures now show the Error(s) fix-instructions dialog with a generic AI prompt. 2. issue -3491: the Process button opens the credit dialog on the first click (warnings no longer block; credit providers are loaded first; a re-entrancy guard debounces double-clicks). 3. issue -3492: the step-4 checklist fourth line now shows "Agent confirmed finished." at step >= 5 instead of "It looks like...". 4. issue -3493: out-of-order same-session processing is blocked with a dialog listing earlier steps and an "OK, take me there" button. Session 154, Step 8: Hide S4 Process button until credit providers load - AIM-2896 Hide Wf S4 Process button until processing is possible (credit providers loaded) Outcome: Implemented in `dashboard-workflow.js`: the Wf S4 `#wfS4BtnProcess` button is rendered only when `creditReady` (credit tracking disabled or `_creditProvidersCache` loaded), and the dynamic area is re-rendered once providers finish loading so the button appears. Fix/Process rendering by severity was verified: warnings → Fix (yellow) + Process; hard error → Fix (red) only; ignored warnings are excluded via `severity === 'ignored'`. Session 154, Step 9: Keep Error(s) dialog open and report concrete session-resolution cause - AIM-2896 Keep Error(s) dialog open for session-resolution failures and report the concrete cause Outcome: Implemented in `dashboard-workflow.js` and `dashboard-project.js`: the session-resolution fix dialog now sets a one-shot `_noAutoRecheck` flag honored by `showFixInstructionsDialog` (the auto-re-check is skipped, so the dialog stays open). `_processS4TaskInternal` now falls back to re-parsing `task.matchedFile.content` to obtain the session number, and reports a concrete error naming the missing session number with a direct-session hint. Session 154, Step 10: Close tracker selects the next step in the same session (or first remaining tab) - AIM-2897 Close tracker selects the next step in the same session (or first remaining tab) - AIM-2894 Serialize catalog.json writes to prevent File System Access write conflict Outcome: 1. `_pickNextS4Task` was rewritten to deterministically select the next sequential same-session step, falling back to the first remaining tab. 2. Catalog file writes were serialized through a promise chain (`_enqueueCatalogWrite`) inside `_writeCatalogJsonFile`, so concurrent writers (e.g. temp-number repair on project load vs. output processing) can no longer open overlapping writables on the same file. Session 154, Step 12: Propagate starting credit changes to sibling running steps with the same provider - AIM-2886 Propagate starting credit changes to sibling running steps with the same provider - AIM-2902 Eliminate catalog.json 'state cached' write failure caused by external editor Outcome: 1. AIM-2886: Removed the shared global active-credit-purchase fallback from the Wf S4 sibling credit propagation and made the per-step provider key the single source of truth — the starting credit value is now only propagated to running steps with the very same provider selected in their dropdown. 2. AIM-2902: Added an InvalidStateError recovery to `AimFS.writeFile` that re-creates a stale file entry with a fresh handle, so catalog.json writes no longer fail when the coding-agent harness edits the file outside the File System Access API.