McBasic™Get McBasic™ ↗
Build 881
Practical guide

Choose AI context & request size

Know what leaves your project, how it is selected and why a large request may be refused before sending.

Choose where the request goes#

ProviderSetup boundary
External CodexA separately installed supported runtime and your configured account/model; it is not bundled with McBasic™.
Responses-compatible APIYour configured HTTPS endpoint and API key, stored in the Mac Keychain.
Local LM StudioA separately installed local server on this Mac, with a loaded model and the Responses API. The connection is restricted to loopback HTTP with an explicit port.

AI is optional. Designing, editing, checking and running a McBasic™ application does not require choosing a provider. Provider access, retention and costs depend on the service you select.

Inspect the exact selection#

  1. Open the AI sidebar with Shift–Command–L.
  2. Review the context chips for the current chat. Choose code, Form layout or both where offered.
  3. Open Show exact content and read what will be shared.
  4. Remove credentials, private records and unrelated documents before sending.
  5. Send a bounded request that names the intended result and what should remain unchanged.

Document-sharing choices are kept per chat while McBasic™ stays open, but are not saved as project consent. Checked proposals expire when switching chats. Reopened chats require a review of the visible chips before Resume; documents created by a plan approved on this Mac can return as visible chips. Scope chips have separate local persistence; see editing scope.

Inspect names as well as source#

Project map is enabled by default and can reveal Form/control names, public signatures, settings and resource or migration names without procedure bodies. The full map also includes short header/public-procedure comment excerpts (up to 100 characters each); its names-only fallback omits them. Review comments for private details too. Remove its chip as well as document and scope chips when asking a question that should share no project information. Show exact content uses the same mode-specific recipe as the next Send and explains omitted context.

The +N overflow button lists all context entries when the row cannot fit them. During a request the list remains readable, but editing is disabled. See the request recipes.

Choose a budget for this provider#

Request size in AI Provider Settings limits selected text, not model tokens. McBasic™ counts UTF-16 code units, so some visible characters, including many emoji, count as two. Automatic currently gives remote providers 240,000 characters: a nominal 40,000 for instructions/conversation and up to 200,000 for authorized context. A known model window can cap the setting; do not treat a character allowance as a guarantee that the loaded model has enough context. Protocol framing and the reference index are additional to this selected-text budget.

Remote request sizeNominal prompt / conversationContext ceiling
Automatic (current default)40,000200,000
60,00010,00050,000
120,00020,000100,000
240,00040,000200,000
480,00080,000400,000
960,000160,000800,000

Above 240,000, Settings warns about cost, latency and model limits. Raise the budget only when the work needs it. The maximum preset is 960,000; the separate technical prompt ceiling is 500,000, even when more total space would remain.

Let a long plan use otherwise empty space#

The context must stay below its own ceiling. Once McBasic™ knows how much context will actually be sent, the assembled prompt may use the unused context allowance. The nominal prompt column is therefore not a hard limit on a generated stage instruction. The combined request still cannot exceed its total, and the prompt remains subject to the 500,000-character technical ceiling.

Request accounting after context fits
Available prompt = min(500,000, nominal prompt + unused context allowance)
Unused context allowance = context ceiling - context actually selected
240,000-character requestAssembled promptResult
60,000 context characters170,000 charactersFits: prompt allowance is 180,000; combined size is 230,000.
60,000 context characters190,000 charactersRefused: prompt is 10,000 above its available allowance.
201,000 context characters1,000 charactersContext is too large even though the total would fit.

The same borrowing rule applies to LM Studio within its selected budget, capped at 120,000 total. The composer still limits the message you type to the nominal prompt portion: initially 40,000 remotely or 20,000 for LM Studio, with less room in an ongoing chat. Borrowing mainly helps assembled requests that carry a plan, decisions and instructions; it is not permission to paste an arbitrarily long message.

Recover from the boundary that actually failed#

McBasic™ first makes the context fit: it can reduce project-map detail, omit optional non-target chips newest first, then remove the remaining map. Required targets and scope stay. It then calculates the prompt allowance and, when needed, leaves out the oldest optional history exchanges. In Fix, optional Last Run output can then be omitted if the prompt is still too large. Omitted material is reported; source files and required instructions are not silently cut short. If required text still cannot fit, nothing is sent.

FailureWhat to change before Retry
Selected context is too largeRemove unrelated chips or share a smaller set of documents. Required targets must still fit.
Stage prompt or approved plan is too largeRaise Request size to a suitable next preset, or stop and request a shorter plan. Removing chips does not shorten the plan text itself.
Remote request already uses the largest presetShorten the plan or divide the remaining work into a new, smaller plan.
LM Studio prompt is too largeShorten the plan, or deliberately choose another provider with a suitable window. Its 120,000-character local cap cannot be raised here; a smaller selected preset can be increased up to that cap.
Typed message or conversation is too longShorten the message, or begin a new chat with a concise summary.

MCB4702 reports a toolchain size refusal before a network request. In a paused plan, read the reason, make the relevant change and press Retry. Repeating the same failing Retry keeps one current error card with working Retry and Stop plan buttons; it does not mean progress occurred. Inspect Show exact content after changing chips, modes or size.

A larger character budget does not increase the 64 selected documents or 32 scope items permitted in one chat. See project limits.

Check your settings without sending source#

  1. Open a disposable practice project and select a configured remote provider; do not Send.
  2. In AI Provider Settings, set Request size to Automatic. Open Show exact content: the context denominator should be 200,000. Record the selected-text count.
  3. Change Request size to 120,000 and reopen the preview. The context denominator should be 100,000; do not assume that any omitted chips are still being sent.
  4. Restore Automatic and confirm the denominator returns to 200,000.
  5. If you already have a local LM Studio setup, switch to it deliberately: Automatic and presets of at least 120,000 give a 100,000 context ceiling; selecting 60,000 lowers that ceiling to 50,000. No local setup is required to complete the remote checks.
  6. Restore your intended provider, budget and chips. Read the exact-content preview once more before a later Send.

Opening the preview or changing Request size does not itself send a request. This exercise verifies settings and selection, not provider connectivity or model capacity. Keep unrelated projects and private files out of the practice chat.

Know what is retained locally#

A chat can contain up to 500 messages and its saved record is limited to 2 MiB. With project chat storage enabled, conversations travel inside .mcbproj; otherwise they stay on the Mac. Before sharing a project, review its saved chats as carefully as its source. See project storage.

Source baseline 20f4bfed6b · Build manifest
Sources & 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.md
  • docs/manual/22-project-files-and-folder-layout.md
  • macos/McBasicIDE/Sources/AIRequestBudget.swift
  • macos/McBasicIDE/Sources/AIFlowPreferences.swift
  • macos/McBasicIDE/Sources/AIContextRecipe.swift
  • src/McBasic.Build/AiProvider.cs
  • src/McBasic.CLI/IdeProtocol.cs
  • src/McBasic.Build/AiProjectMap.cs
  • src/McBasic.Build/LmStudio.cs
  • src/McBasic.Build/AiProvider.cs
  • macos/McBasicIDE/Sources/AIRequestBudget.swift
  • macos/McBasicIDE/Sources/AIProviderController.swift