Skip to content

cc's MCP debug logger writes nothing under perry — even when its catch handler demonstrably runs; and exec/execFile callback order is inverted #9500

Description

@proggeramlug

Two secondary findings from the #9485 investigation (PR #9498).

1. The MCP debug log tree is never created

Node writes 6 lines to ~/.cache/claude-cli-nodejs/<key>/mcp-logs-*/…jsonl on a failed connect. Perry writes nothing — no .cache tree at all — even though the bundle's OL catch demonstrably runs (i8(...)/yz(...) execute; the connect returns type:"failed", not the outer BX5 catch).

#9485 assumed the missing logs were purely downstream of never connecting. That is now disproven: the connect fails, the error path runs, and the logger is still silent. Most likely an async-write/exit-flush gap adjacent to the #9421 family (merged PR #9491 fixed appendFile error-swallowing; this logger may use a different write shape — createWriteStream is still synchronous-under-the-hood per #9493, and a failed dir-creation on this path would now throw post-#9491 rather than vanish — re-test on a post-#9491 build first, the behaviour may have changed).

Why it matters: this is why #9485 had zero diagnostics to start from. Debug logging that dies silently multiplies the cost of every other bug.

2. cp.exec / cp.execFile callbacks fire in the opposite order vs node

perry: exec→execFile; node: execFile→exec (same script, same commands). Ordering-sensitive test suites and promisified-parallel patterns can see it. Small, but it is a scheduling-semantics divergence in freshly-unlocked territory (PR #9498 made these callable as cp.exec(...) at all), so it was previously unreachable.

3. Drift-capable duplicate knowledge (maintenance, not behaviour)

is_cjs_style_native_default_import, cjs_default_namespace_name, cjs_default_base_module, and the dispatch router's table were four hand-maintained copies of the same module-name knowledge; #9498 collapsed the router's copy onto the canonical one with ratchet tests. The other three remain and can drift exactly the way the router did. A follow-up that derives them from one source kills the recurring-bug factory.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions