Skip to content

debug(windows): trace the Kimi configuration readback failure [do not merge] - #11723

Closed
IvenKooLab wants to merge 1 commit into
morluto:mainfrom
IvenKooLab:debug/windows-kimi-readback
Closed

IvenKooLab wants to merge 1 commit into
morluto:mainfrom
IvenKooLab:debug/windows-kimi-readback

Conversation

@IvenKooLab

Copy link
Copy Markdown
Contributor

Temporary debug PR, not for review or merge. It adds Windows-only diagnostics to src/application/SetupClientConfiguration.ts so the Kimi configuration readback failure recorded on main's Windows lane can be located.

Failure under investigation (main d6bcfc10, Windows capability and package lane):

tests/boundary/filesystem/clientConfigurationEnvironment.test.ts > preserves a lowercase explicit Kimi schema profile instead of inserting a conflicting default
AssertionError: expected { Object (status, reason) } to match object { status: 'configured' }

Reported with reproduction steps on #10532. This branch prints REA-WIN-DEBUG lines from the configuration stages and readback comparison; it will be closed as soon as the trace is captured and the real fix is proposed.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5

[High impact] The trace reaches stderr during Windows client setup and can include configuration values.

Do not merge while the mismatch trace can print transport credentials.

Findings

  1. P1 Security Credentials appear in debug logs ▶
Fix with agent prompt
### Issue 1
src/application/SetupClientConfiguration.ts:521-523
On a readback mismatch, this trace prints whole server entries and the first 400 characters of the configuration file. If those values contain transport credentials, such as an `Authorization` header on another server, `winDebug` copies them unchanged to stderr on Windows. Sharing the diagnostic log can then expose those credentials.

`AGENTS.md` requires transport authentication credentials to be redacted. Log the differing field names and comparison results instead of whole values or raw configuration text.

**How this was verified:** The mismatch branch passes configuration text and server entries directly to `winDebug`, which writes them to stderr without redaction.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds temporary configuration-stage and readback traces to stderr on Windows, or when REA_WIN_DEBUG=1.

  • Windows client setup now prints a trace of its configuration path.

Reviews (1) · Last reviewed commit: "debug(windows): trace the Kimi configura..." · Reviewed by Greptile

Comment on lines +521 to +523
winDebug(
`readback-mismatch registered=${String(registrationCurrent(readback, desired))} readback=${JSON.stringify(readback.servers[PRODUCT_IDENTITY.mcpServerKey])} desired=${JSON.stringify(desired)} fallback=${JSON.stringify(fallbackServers)} text=${JSON.stringify(text.slice(0, 400))}`,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Credentials appear in debug logs

On a readback mismatch, this trace prints whole server entries and the first 400 characters of the configuration file. If those values contain transport credentials, such as an Authorization header on another server, winDebug copies them unchanged to stderr on Windows. Sharing the diagnostic log can then expose those credentials.

AGENTS.md requires transport authentication credentials to be redacted. Log the differing field names and comparison results instead of whole values or raw configuration text.

How this was verified: The mismatch branch passes configuration text and server entries directly to winDebug, which writes them to stderr without redaction.

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/application/SetupClientConfiguration.ts
Line: 521-523

Comment:
**Credentials appear in debug logs**

On a readback mismatch, this trace prints whole server entries and the first 400 characters of the configuration file. If those values contain transport credentials, such as an `Authorization` header on another server, `winDebug` copies them unchanged to stderr on Windows. Sharing the diagnostic log can then expose those credentials.

`AGENTS.md` requires transport authentication credentials to be redacted. Log the differing field names and comparison results instead of whole values or raw configuration text.

**How this was verified:** The mismatch branch passes configuration text and server entries directly to `winDebug`, which writes them to stderr without redaction.

**Context Used:** AGENTS.md ([source](https://github.com/morluto/rea/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Temporary instrumentation, Windows-only (or REA_WIN_DEBUG=1). It prints the
configuration stages and the readback mismatch so the failure recorded on
main's Windows lane can be located before any behaviour changes.
@IvenKooLab

Copy link
Copy Markdown
Contributor Author

Trace captured, so this debug PR is closed and its branch deleted. The failure was not Windows-specific: the fixture wrote rea_mcp_input_schema_profile: "full", a retired profile the reader now refuses, so configureClientConfiguration returned failed/readback before writing.

Windows-lane trace (Kimi case):

REA-WIN-DEBUG entry client=kimi format=kimi platform=win32 …
REA-WIN-DEBUG files-not-ok {"kind":"malformed", … "detail":"… REA_MCP_INPUT_SCHEMA_PROFILE accepts only \"compact\", the default. The \"full\" input profile was removed …"}
REA-WIN-DEBUG result {"status":"failed","reason":"readback"}

The fix is #11725 (test fixture on compact, and the case no longer skips non-Windows platforms, which is why the rot went unnoticed).

@IvenKooLab IvenKooLab closed this Nov 16, 2026
@IvenKooLab
IvenKooLab deleted the debug/windows-kimi-readback branch November 16, 2026 10:30
@morluto morluto added the area: setup Setup, packaging, upgrade, install, Doctor, and client registration label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants