Skip to content

fix: print why a service failed instead of naming a log file - #52

Merged
imran-siddique merged 1 commit into
mainfrom
fix/show-the-error-not-the-log-path
Aug 21, 2026
Merged

fix: print why a service failed instead of naming a log file#52
imran-siddique merged 1 commit into
mainfrom
fix/show-the-error-not-the-log-path

Conversation

@imran-siddique

Copy link
Copy Markdown
Member

When cMCP Runtime fails to bind, the launchers wait the full 60 seconds and then say "See the *.log files in this demo folder." The reason is already in cmcp.log, and nobody looks there.

The case that costs the most time is a cmcp on PATH that is present but broken, which is easy to end up with alongside an editable dev install. I hit exactly this while verifying the claims on agentrust-io.com/demos: a minute of waiting, then a sentence pointing at a file.

Before

-- Starting cMCP Runtime (CMCP_DEV_MODE=1) on :8443 --
cMCP Runtime did not start listening on :8443 within 60s. See the *.log files in this demo folder.

After

-- Starting cMCP Runtime (CMCP_DEV_MODE=1) on :8443 --
cMCP Runtime exited with code 1 before listening on :8443.

Last 15 lines of cmcp.log:
    ...
      from agent_os.mcp_gateway import GovernancePolicy, MCPGateway
    ImportError: cannot import name 'GovernancePolicy' from 'agent_os.mcp_gateway'

Both branches are covered: the one where the process exits early, and the one where it never binds. Applied to the four demo launchers and the web console, which each carry their own copy of the wait helper by design, so each gets its own.

Verification

Reproduced a real failure and confirmed both branches print the tail. The success path is an untouched early return, so it is unchanged rather than re-verified.

Not fixed here

_find_cmcp() takes the first cmcp on PATH without checking that it runs, so a broken install still shadows a working .venv and the README's "it will use a local .venv if one exists" never engages. That needs a functional probe, and there is no cheap subcommand that exercises the same import start does: --version and validate-config both succeed against an install whose mcp.proxy import is broken. Worth a follow-up.

🤖 Generated with Claude Code

https://claude.ai/code/session_013EQx4N5BzTQbY8kvXUsdkY

When cMCP Runtime fails to bind, the launchers wait the full 60 seconds
and then say "See the *.log files in this demo folder." The reason is
already in cmcp.log, and nobody looks there.

The case that costs the most time is a cmcp on PATH that is present but
broken, which is easy to end up with alongside an editable dev install.
Both launcher branches, the one where the process exits early and the
one where it never binds, now print the tail of the relevant log.

Before:
    cMCP Runtime did not start listening on :8443 within 60s.
    See the *.log files in this demo folder.

After:
    cMCP Runtime exited with code 1 before listening on :8443.

    Last 15 lines of cmcp.log:
      ...
      ImportError: cannot import name 'GovernancePolicy' from
      'agent_os.mcp_gateway'

Applied to the four demo launchers and the web console, which each carry
their own copy of the helper by design.

Verified against a real failure on both branches. The success path is an
untouched early return.

Not fixed here: _find_cmcp() takes the first cmcp on PATH without
checking that it runs, so a broken install still shadows a working
.venv. That wants a functional probe, and there is no cheap subcommand
that exercises the import the way `start` does.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013EQx4N5BzTQbY8kvXUsdkY
@imran-siddique
imran-siddique requested a review from a team as a code owner August 21, 2026 04:32
@imran-siddique
imran-siddique merged commit adfceeb into main Aug 21, 2026
4 checks passed
@imran-siddique
imran-siddique deleted the fix/show-the-error-not-the-log-path branch August 21, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant