Skip to content

[BUG] The InfiniteAIAssistant command type is unreachable, unconfigurable, and silently skipped at run time #1571

Description

@chhoumann

Found while bringing the four imperative format previews under the #1560 inert-preview mechanism (#1565) - AIAssistantInfiniteCommandSettingsModal.ts is one of the four, and it turns out nothing can reach it.

Describe the bug

CommandType.InfiniteAIAssistant exists, has a full settings modal
(src/gui/MacroGUIs/AIAssistantInfiniteCommandSettingsModal.ts, 275 lines: result
joiner, chunk separator, max chunk tokens, merge chunks, sampling params), a
IInfiniteAIAssistantCommand interface, package-disclosure support
(src/services/packagePreview.ts:637), model-ref pinning
(src/ai/modelRefPinning.ts:15) and a migration
(src/migrations/refreshStaleDefaultModelSeeds.ts:95).

But:

  1. You cannot create one. The macro builder's add-command menu offers "Add AI
    Assistant command" only - there is no InfiniteAIAssistant entry anywhere in
    CommandList.svelte or MacroBuilder.ts.
  2. You cannot configure one. CommandList.svelte:243 only renders a configure
    affordance for CommandType.AIAssistant. Verified live: seeding a macro with
    an InfiniteAIAssistant command renders the row with Delete and Reorder
    buttons but no Configure button.
  3. It does nothing at run time. MacroChoiceEngine.executeCommands
    (src/engine/MacroChoiceEngine.ts:292-306) is a flat chain of if (isXCommand(command)) guards with no InfiniteAIAssistant branch and no
    else. The command is silently skipped - no error, no notice, no log.
  4. The modal is only ever constructed from the devMode-only testQuickAdd
    command (src/main.ts:194), which additionally passes
    type: CommandType.AIAssistant for an IInfiniteAIAssistantCommand - so even
    the dev harness builds a mistyped object.

So the code is dead, but not inertly dead: a package importing a macro that
contains one will show "AI assistant" in the import disclosure
(MacroDisclosure.svelte:16) and then do nothing when the macro runs.

Expected behavior

Either wire the type up (creatable in the macro builder, configurable, executed
by the engine) or remove it and migrate any InfiniteAIAssistant commands found
in existing data - but not the current state, where the disclosure promises a
step that the engine drops on the floor.

Given nobody can have created one through the UI in the currently-supported
versions, removal + a migration that converts them to a plain AIAssistant
command (or drops them with a notice) looks like the smaller, honest fix. Worth
checking whether an older QuickAdd could create them before deciding.

Additional context

Deliberately not folded into #1565's diff, which stays at the preview/call-site
layer. #1565 still fixes this modal's preview so the two AI prompt modals do not
diverge, whichever way this issue is resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions