# CLI 0.0.4-microsoft-preview.19

Microsoft migration engine preview. Stable `latest` remains 0.0.3.

## Ollama runtime changes

- Phase-specific context allocation and optional `agent.phaseContextWindowTokens` overrides. `agent.contextWindowTokens` is the ceiling, not an allocation forced on every phase. The configured model is unchanged.
- Model-specific token counting using the installed Ollama GGUF vocabulary/merges for the verified Qwen2 tokenizer and raw prompt template. Unsupported templates/models keep the conservative byte guard. No tokenizer/model downloads or evidence truncation.
- Complete Microsoft prerequisite text is retained without redundant JSON escaping. Every prompt is checked before inference; suspicious server input-token counts reject the response before tool execution.
- Model context capacity is checked for all phases before inference. GPU/CPU placement is checked before sending stage prompts, including loading the existing model at the selected context where needed. CPU offload is explicitly reported.
- Configurable finite `agent.requestTimeoutSeconds` (default 3600) and `agent.inactivityTimeoutSeconds` (default 1800). Empty keepalives cannot bypass inactivity; continuous streaming cannot bypass the absolute deadline. Timeouts report `MODEL_TIMEOUT` with a remedy and never accept partial output.
- Progress includes characters/second, first-output latency and server-measured final tokens/second when available.

## Configuration

Merge into your existing `agent` section:

```yaml
agent:
  provider: ollama
  model: qwen3-coder:30b
  contextWindowTokens: 65536
  maxOutputTokens: 8192
  requestTimeoutSeconds: 3600
  inactivityTimeoutSeconds: 1800
```

This 64K example fits the tokenizer/template verified on the test server. Unknown
templates retain the conservative guard and may need more capacity. Explicit
phase overrides must fit inside the global ceiling. Larger evidence may require
additional capacity; never bypass source coverage or finalization checks.

## PowerShell update

```powershell
Invoke-WebRequest 'https://tools.lambogenius.com/lambogenius-integration-migration/0.0.4-microsoft-preview.19/install-cli.ps1' -OutFile install-cli-preview19.ps1
# Review the downloaded script before running it.
& .\install-cli-preview19.ps1 -SkipDependencies
li.cmd --version
```

Expected version: `0.0.4-microsoft-preview.19`. Preserve earlier outputs and use a
fresh generated workspace because the engine fingerprint changes. Do not edit
checkpoint fingerprints to force resume. Installation does not reset license counters.

## Verification and limitations

234 CLI tests, 88 Microsoft-core tests and 24 installer/release tests passed
(346 total). Compilation and lint passed.
Regression coverage includes tokenizer fallback/Unicode, per-phase ceilings,
cold-model placement, finite absolute/inactivity deadlines, empty keepalives,
partial token accounting and rejection of truncated server prompts.

The local qwen3-coder:30b probe succeeded, including Unicode/special-token
measurement and GPU placement diagnostics. Complete planning instructions
measured about 31.4K tokens and fit a 64K context, versus the old 256K allocation.

The FINACCONT-BT live grouping qualification retained 98 selected files and five
orchestrations. It read the graph and artifact inventory, rejected an invented
flow reference, then reached the deliberately bounded 180-second test deadline
while generating its fourth response. It did not finalize grouping. Source
bytes were unchanged. The tested 8GB GPU still offloaded 75.5% of model memory
to CPU at 64K. This preview improves budgeting, diagnosis and timeout control;
**it does not claim a completed FINACCONT-BT migration or eliminate hardware limits.**
