Skip to content

Deploy tools: answer logging/setLevel, and shorten the icp_deploy_bundle description - #265

Merged
aterga merged 3 commits into
mainfrom
deploy-logging-set-level
Nov 19, 2026
Merged

aterga merged 3 commits into
mainfrom
deploy-logging-set-level

Conversation

@aterga

@aterga aterga commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Two follow-ups to #261, on top of main now that it has merged.

1. Answer logging/setLevel

The deploy handler declares the MCP logging capability and did not handle logging/setLevel, so a client that sent it got method not found. #261 accepted that gap for a follow-up.

  • WithDeploy answers logging/setLevel, and LocalServer passes the request on to it.
  • The deploy tools log at one level, info, so the level decides whether they log at all. A client that asks for messages from a level above info only is sent none by a deploy without a progress token; a level at or below info turns them back on. The deploy's answer carries every line either way.
  • Progress notifications under a progress token are unaffected: the request asked for those itself.

The level belongs to the handler. On imcp2-local (stdio) that is the connection: it applies from the moment it is set, to later deploy calls and to one already running. The hosted transport is stateless, with a handler per request, so a level set there is accepted and applies to no later call.

2. A shorter description for icp_deploy_bundle

As suggested in review of #261. The description no longer lists the phases of a deploy, or says which argument carries the bundle and what the environment is called: the arguments describe themselves.

It keeps one sentence on how to hand the bundle over, and that sentence is per server, put in where the tool list is already fitted to the server:

  • a server with an upload store (hosted): "Upload that bundle using icp_deploy_upload."
  • a server without one (imcp2-local): "Pass that bundle's absolute path as bundle_path."

One description for both would tell an agent on the local server to use a tool that server does not list.

Tests

  • imcp2-local, with a real MCP client over a pipe: logging/setLevel is answered, and levels above and below info turn the messages off and on.
  • Hosted, over the composed router: logging/setLevel gets a result, not an error.
  • The choice of channel (progress token, log messages, or neither) and the level mapping.
  • Each kind of server's deploy tool description carries its own sentence on the bundle and names nothing the other kind has.

https://claude.ai/code/session_01VP2vTFUYW9ZKb1Rjv176Za


Generated by Claude Code

@aterga
aterga requested a max review from Copilot November 19, 2026 19:17
@aterga
aterga marked this pull request as ready for review November 19, 2026 19:17
@aterga
aterga requested a review from a team as a code owner November 19, 2026 19:17
The deploy handler declares the MCP logging capability, since a deploy sent
no progress token reports its phases as log messages, but did not handle
`logging/setLevel`: a client that sent it was told there is no such method.

`WithDeploy` now takes the request, and `LocalServer` passes it on. The
deploy tools log at one level, `info`, so the level decides whether they log
at all: asked for messages from a level above `info` only, a deploy without
a progress token sends none (its outcome still carries every line), and a
level at or below `info` turns them back on. Progress under a token is the
request's own asking and is sent whatever the level.

The level is the handler's. On imcp2-local that is the connection. The
hosted transport is stateless, a handler per request, so a level set there
is accepted and applies to no later call.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VP2vTFUYW9ZKb1Rjv176Za
sea-snake
sea-snake previously approved these changes Nov 19, 2026
…undle's way in per server

The description of `icp_deploy_bundle` no longer lists the phases of a
deploy or says which argument carries the bundle and what the environment
is called: the arguments say that themselves. As suggested in review of
#261.

It keeps one sentence on how to hand the bundle over, and that sentence is
the server's own, put in where the tool list is already fitted to the
server: one with an upload store says to upload the bundle with
`icp_deploy_upload`; one without says to pass its path as `bundle_path`.
One description for both would name, on the local server, a tool that
server does not list.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VP2vTFUYW9ZKb1Rjv176Za
@aterga
aterga changed the base branch from deploy-core-all to main November 19, 2026 19:22
@aterga
aterga dismissed sea-snake’s stale review November 19, 2026 19:22

The base branch was changed.

@aterga
aterga force-pushed the deploy-logging-set-level branch from 14448db to d832e0e Compare November 19, 2026 19:22
@aterga aterga changed the title Deploy tools: answer logging/setLevel Deploy tools: answer logging/setLevel, and shorten the icp_deploy_bundle description Nov 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Stdio deployments without progress tokens snapshot the logging level, so runtime logging/setLevel changes do not stop or resume their log notifications as expected.

1 open issue
What changed in this PR

Adds logging/setLevel handling to the deploy MCP tools, closing the logging-capability gap accepted in #261.

Changes:

  • Handles level requests in WithDeploy and forwards them from the local server.
  • Filters tokenless deploy log notifications while preserving progress notifications and complete logs in deploy results.
  • Adds level-mapping, local-client, and hosted-router tests.
File Description
src/​deploy.rs Tests that the hosted endpoint accepts logging/setLevel.
crates/​imcp2-local/​src/​server.rs Forwards level requests and tests them over an MCP connection.
crates/​imcp2-core/​src/​deploy/​server.rs Stores the handler’s logging preference and passes it to deploy calls.
crates/​imcp2-core/​src/​deploy/​mod.rs Adds notification-channel selection, level filtering, and unit tests.

Review effort: Max

Comment thread crates/imcp2-core/src/deploy/server.rs Resolved
Copilot AI max review requested due to automatic review settings November 19, 2026 19:26
The level a client sets with `logging/setLevel` was read once, as a deploy
call began, so one set while a deploy was running changed nothing for it: a
deploy that began logging went on to its end, and one that began muted
could not be heard again.

The handler's flag is now shared with the deploy calls running, which read
it for each line they send. Progress under a progress token is as before,
whatever the level.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VP2vTFUYW9ZKb1Rjv176Za
@aterga
aterga requested a review from sea-snake November 19, 2026 19:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Deploy logging snapshots the filter for the entire run, so runtime level changes cannot suppress or resume info notifications as expected.

1 open issue
1 resolved since last review

Review effort: Max

Comment thread crates/imcp2-core/src/deploy/server.rs Resolved
Copilot AI max review requested due to automatic review settings November 19, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

An unpublished documentation concern about token-dependent progress notifications and log-level-filtered messages requires human assessment.

No open issues 🎉

1 resolved since last review

Review effort: Max

@aterga
aterga merged commit c00bbc5 into main Nov 19, 2026
17 checks passed
@aterga aterga mentioned this pull request Nov 19, 2026
6 of 8 tasks
@raymondk raymondk mentioned this pull request Nov 19, 2026
6 of 8 tasks
aterga pushed a commit that referenced this pull request Nov 19, 2026
* Bump crates to 0.7.0

All three crates share one version. A minor bump: since 0.6.1 the server
gained the deploy tools (bundle host, upload store, pipeline, MCP tools,
remote serving and metrics, #261, #265, #266), the cap on the MCP request
body behind the bearer gate (#241), vetted-connector branding surfaced to
Internet Identity (#200), and get_canister_candid now carries the interface
text in its structured output (#229).

The rc-0.7.0 candidate needs this on main first: deploy-candidate.yml and
publish-crate.yml both refuse a tag whose version disagrees with every
Cargo.toml.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VP2vTGJNrpdaVxN1aY8XSX

* Deploy tools: say per server how to hand icp_deploy the bundle again

#266 rewrote the icp_deploy description and hard-coded its step (2) as
"upload that bundle via icp_deploy_upload". The local server does not list
that tool: it takes the bundle as `bundle_path`. The sentence that
IcDeployTools::tools() put in per server was anchored on text the rewrite
removed, so it silently stopped being put in, and
a_server_lists_the_bundle_argument_it_takes has failed on main since.

Step (2) is now the anchor. The description says "hand that bundle to this
tool", and each server replaces that with its own way in: upload via
`icp_deploy_upload` on a server with an upload store, the bundle's absolute
path as `bundle_path` on one without. The hosted server's text is what #266
wrote, with the tool name in backticks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VP2vTGJNrpdaVxN1aY8XSX

* README: depend on imcp2 0.7

`imcp2 = "0.6"` matches 0.6.x only, and the README ships in the crate, so a
reader of 0.7.0's page would be told to depend on the release before it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VP2vTGJNrpdaVxN1aY8XSX

* Deploy tools: keep the description's step (2) as written

Review asked for the description's text back. The tool's description in
the source says step (2) as #266 wrote it, "upload that bundle via
icp_deploy_upload", and the hosted server lists it unchanged. Only a
server without an upload store, imcp2-local, puts "pass that bundle's
absolute path as `bundle_path`" in its place, since it lists no
icp_deploy_upload.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VP2vTGJNrpdaVxN1aY8XSX

---------

Co-authored-by: Claude <[email protected]>
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.

4 participants