Consolidate the UTF-8/16/32 BOM byte literals into a single lookup table
and share a startsWith helper across detection and encoding. Pure
refactor in a Kilo-only file; upstream diff unchanged.
Users that hand us BOM-less UTF-16/32 are violating the documented
contract; trust jschardet + iconv.encodingExists and let the result
be whatever it is.
* fix(cli): restore kilo branding in MCP auth toast and client name
The 'Run: opencode mcp auth' popup / toast and the MCP protocol client
'name' field were reverted to 'opencode' by an upstream refactor
(opencode PR #22913, pulled in via Kilo PR #9346). Re-apply the
Kilo-branded strings with narrow kilocode_change markers and add a
regression test in packages/opencode/test/kilocode/ so the next upstream
merge fails a Kilo-owned test instead of shipping an 'opencode' popup.
* fix: use kilocode_change block markers for startAuth signature
---------
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: marius-kilocode <marius@kilocode.ai>
* fix(cli): serialize OAuth callback port tests
* fix(cli): close MCP OAuth browser test listener race
The mock subprocess emitted its error via setTimeout(10ms), which raced the error listener attachment on slow Windows CI and left BrowserOpenFailed unpublished. Emit on newListener('error') via a microtask so the listener is always attached first. Revert the unrelated test-runner serialization.
* fix(cli): deliver MCP OAuth mock error to listener directly
Override subprocess.on in the mock so the error is queued to the registered listener as soon as it attaches. The previous newListener + emit chain still lost events on slow Windows CI because EventEmitter dispatch can race microtask draining.
The upstream build script tries to bundle packages/app/ which was removed in #9845. Guard the embed step so the CLI build still works, and revert the --skip-embed-web-ui workaround from #9885 since it is no longer needed.
The nullish coalescing operator (??) treats null as a falsy value and
falls through to the right-hand operand. Switch to a strict undefined
check so that a null assignment on `steps` is forwarded as-is, allowing
callers to express an intentional reset of the steps configuration.
Resolve conflicts after main's config.ts refactor to @effect/schema and
the messages.ts → messages/ directory split:
- Port AgentConfig nullable fields + default_agent nullable to the new
packages/opencode/src/config/agent.ts and config.ts Effect schemas.
The null delete sentinel for steps is already preserved by main's
normalize() (steps excluded from spread when undefined).
- Move AgentConfig nullable fields and Config.default_agent nullable to
the new messages/agents.ts and messages/config.ts.
- Re-apply the core fix to ModeEditView.tsx hidden/disable toggles:
send explicit false instead of val || undefined so deepMerge
overwrites a previously-saved true. Keep default_agent clear via
null delete sentinel when hiding/disabling the current default.
- Drop configSaved/configSaveFailed messages; main's retry + optimistic
fallback in KiloProvider and configUpdateFailed + saveError signal in
ConfigProvider subsume the PR's save-outcome split.
Replace nullish coalescing with explicit undefined check so that
`steps: null` is not collapsed to `maxSteps`, preserving the ability
to clear the steps override via a null sentinel value.