Choose an AI chat mode
Separate questions, planning, explanations, fixes and selected review changes before sending a request.
Choose intent before writing the request#
Use the / button or Command–/ in the composer to select a persistent mode. The coloured pill shows the chat’s current mode. A new chat starts in Build; the choice is stored with that chat. You cannot switch modes while a request is running.
| Mode | Command | Can change the project? | Use it to |
|---|---|---|---|
| Build | /build | Yes, through checked proposals | Implement a bounded change or execute an approved plan. |
| Plan | /plan | No; approval switches to Build | Answer an interview and review staged work before implementation. |
| Ask | /ask | No | Resolve a question without authorizing a modification. |
| Fix | /fix | Yes, with a minimal repair | Resolve diagnostics or a bug described by steps, expected behavior and actual behavior. |
| Review | /review | Only after Apply selected | Inspect findings and choose which corrections to request. |
| Explain | /explain | No | Understand the selected code, controls or scope. |
Use the mode menu with mouse or keyboard#
Each row shows a coloured dot, the mode name and a short explanation below it. The current mode has a checkmark; colour alone is not the selection indicator. Click anywhere in the row, or move with the arrow keys and press Return. Escape closes the list without choosing. VoiceOver identifies the selected mode.
Understand which documents a bug report selects#
With no diagnostics and no scope, Fix proposes up to eight additional documents: ones named in the report, plus Forms, modules or classes referenced by the chosen documents’ code. If there are no chosen or named documents, it starts from the startup Form. References found only in BASIC comments or string literals do not count.
Use exact names such as frmNewGame or SudokuGenerator. Compound names can also match case-insensitively, or as separate words such as New Game or sudoku generator. Avoid relying on generic words such as main or grid; short names require the exact spelling, and a one-letter name is not inferred. These are context suggestions, not authorization to edit everything in the project.
A removed report-proposed document stays out for that chat rather than being immediately re-added. Review Show exact content because normal request-budget limits may omit optional source. Scope remains an independent edit boundary; adding context never overrides it.
Share a bounded last Run, or leave it out#
Fix can include the last 2,000 characters of the latest Run output and its exit status. The Last Run output chip is removable. From build 840, removing it disables Run-output sharing for this chat, including later Runs. Restore it explicitly with + Add → Last Run output (Fix). A new Run replaces the available evidence; editing the project invalidates it. Automatic resends after a card answer or a pre-Fix Check never include output newer than your last explicit Send.
A normal run with no output has no useful evidence block. Stop alone is not a failure; when output exists, its ending can be labelled as stopped. Output is marked untrusted program data, never a source of instructions. Inspect it for private values before sending. Under budget pressure, optional history is reduced before the Run output is omitted; omissions are reported.
Use a command without changing the chat#
/ask What does Form_QueryUnload allow me to cancel?
/explain Explain cmdGreet_Click without changing it.A recognized command at the start changes that message’s mode only. The composer pill stays unchanged, and the sent message carries its own mode tag. An unknown command or a slash later in the text is ordinary text. Use the picker when you want the new mode to persist.
Answer a question as a decision#
A question card ends the current AI reply. Select an option, use Other… or type an answer in the composer. A multiple-choice card uses checkboxes and Confirm. While a question waits, a typed message is its answer and uses the question’s mode.
The answer becomes a decision carried into later requests; it is not an implicit approval of generated code. If the same reply contained a proposed change, that proposal is set aside until after the answer. Pending questions survive a restart. Retry and Edit are unavailable for a question/answer exchange because its decision must remain in the record.
Move from interview to an approved plan#
- Choose Plan and describe the intended users, task and data.
- Answer the questions and inspect What we decided. Use Stop asking, draft the plan when the recorded decisions are enough.
- Open Details on Draft 1 and inspect windows, data and stages.
- Request a correction in Plan to receive a complete revised draft; previous drafts become read-only.
- Choose Approve and run only after reviewing the latest draft. The chat switches to Build and starts checked stages.
Discard plan ends the interview without implementing it. Switching away from Plan pauses the interview. A plan may retain up to eight drafts and a chat up to 128 decisions. Continue with the planning exercise.
Fix an error or a bug that passes Check#
When diagnostics are absent or older than your latest edit, Send first requests a current Check, even if automatic checking is disabled. Checking before Fix is not a provider request. If that Check adds unseen chips, review them and press Send again; if the Check cannot start, nothing is sent. Fix can use the latest Check, Run or Test diagnostics, or your description of incorrect behavior when there are no diagnostics. Cancellation MCB4002 from pressing Stop is excluded: stopping the app is not a code defect. Diagnostic-related source appears as chips for review. For a clean Check and a behavioral bug, describe steps, expected result and actual result; name the relevant Form or module.
If Send adds source chips from your report, it stops before contacting the provider. Read the note and inspect the chips, then press Send again. Retry uses the same two-step review when it adds chips. With a scope, that scope is the target and no report-selected documents are added. Practice the complete bug-report repair.
Review produces findings without immediately editing. Tick the findings you accept and use Apply selected to send a new change request. If no chips or scope exist when Review is selected, McBasic™ proposes the open Form as context. Read the chips before sending. Apply selected is still constrained by scope and the configured apply policy.
Allow only the documents the repair needs#
Before a Fix or repair, an error in a document missing from the request or outside its scope produces an Allow/Deny card. Read the exact file paths and requested parts: a layout-only diagnostic can need only .form.json, while a whole Form can require code and layout. Allow sends the named parts and expands an existing scope only as stated. A document dropped by the request budget must actually fit before it can be sent; a chip alone is not proof that it travelled.
Deny reports each consequence: already-sent context can remain read-only, and unsent source stays out. Its errors can remain unresolved. Denied documents are not automatically offered again in that chat. A failed Check that only opens this card does not consume a repair attempt. If your message or mode changes while the card waits, Allow does not silently send the old request: review and press Send yourself.
The AI can also request one to eight documents, with a reason, through request_documents. Its request ends that reply and waits for your decision. Availability depends on the request mode; approved plan-stage requests do not offer this tool; it is not permission for arbitrary file access.
Know what accompanies each request#
| Request | Conversation and work context |
|---|---|
| Build / Ask | Up to six recent exchanges, decisions, selected work and project map. |
| Plan | The interview, decisions and current draft, plus selected work and project map. |
| Explain | Up to six exchanges and the work being explained. |
| Fix | Diagnostics and their documents, or your bug report and selected documents; optional Last Run output; up to two exchanges. |
| Review | The review target, without chat history. |
| Apply selected | The target and the findings you ticked. |
| Approved stage | Stage instructions, decisions/approved plan, relevant documents and scope; no chat history. An incomplete stage can continue with up to three follow-up slices. |
The McBasic™ reference accompanies requests. The project map is removable and contains names/signatures and short documentation-comment excerpts, not procedure bodies. Scope, when present, travels in every mode; a read-only mode remains read-only. Check Show exact content and budget behavior.
20f4bfed6b · Build manifestSources & maintenance
Original web explanation, reviewed against these repository sources. API tables and example files follow the implementation.
docs/manual/16-working-with-the-ai-assistant.mdsrc/McBasic.Build/AiChatRequest.csmacos/McBasicIDE/Sources/AIChatModes.swiftmacos/McBasicIDE/Sources/AIQuestions.swiftmacos/McBasicIDE/Sources/AIContextRecipe.swiftmacos/McBasicIDE/Sources/AIProviderController.swiftsrc/McBasic.Build/AiAskUser.cssrc/McBasic.Build/AiProjectMap.cssrc/McBasic.Build/AiReference/AiCodeAdvisories.csmacos/McBasicIDE/Sources/AutoCheck.swiftsrc/McBasic.Build/LmStudio.cssrc/McBasic.Build/AiProvider.csmacos/McBasicIDE/Sources/AIRequestBudget.swiftmacos/McBasicIDE/Sources/AIProviderController.swift
Review explanations as well as generated code#
AI instructions now ask for purpose comments on documents and procedures and explanations of non-obvious decisions, in the language of your request. Existing useful comments should be preserved and updated. MCB4778 advises on an added or changed procedure longer than 15 nonblank lines with no comment inside it or within three lines above its header; MCB4779 advises on a new code document without a header comment. These are non-blocking advisories after Check, with a correction round and then notes, not new compiler errors on untouched user code.
The full Project map can include a document header’s first line and a public procedure comment’s first sentence, capped at 100 characters per excerpt. The names-only budget fallback omits these comments along with signatures. Inspect these summaries too: a comment can contain private information even when no procedure body is sent.