Skip to content

docs(mcp): no migration command -- record the decision and the recipe (#390) - #581

Merged
padak merged 3 commits into
mainfrom
docs/mcp-migration-is-manual
Aug 12, 2026
Merged

docs(mcp): no migration command -- record the decision and the recipe (#390)#581
padak merged 3 commits into
mainfrom
docs/mcp-migration-is-manual

Conversation

@padak

@padak padak commented Aug 12, 2026

Copy link
Copy Markdown
Member

Decision: kbagent agent migrate-mcp-tasks will not be built. Migrating a
scheduled --type mcp_tool task before v0.85.0 is manual, or AI-assisted.

The reasoning that killed automatic rewriting also argues against a
plan-generator: the parity map knows which native command replaces each tool
but not how to map arguments -- mcp_tool params are the MCP tool's own input
dict (componentId) against CLI flags (--component-id), with different
shapes for several tools. An agent reading --help next to the task's actual
input does that mapping better than any generator we could ship, and has a
human confirming. Detection already landed in #557, which is the part that
could not be improvised: doctor names every affected task and its
native_command, and agent list / serve /agents carry a deprecation key.

So this is documentation, not tooling:

  • gotchas.md states plainly that no command exists and why, then gives the
    four-step recipe (doctor for the ids, agents.json for the input, --help for
    the flags, agent update + one agent run before trusting the cron).
  • keboola-expert.md gets a one-line trigger pointing at it, kept short on
    purpose: that file is at 61.6 KB of its 62 KB budget.

Note the residual risk, since it is a judgement and not a measurement: we have
no telemetry, so "probably nobody uses this" is a call about the user base, not
an observation. If it is wrong the failure mode is a silently dead cron task --
but kbagent doctor now surfaces exactly that, which is why the decision is
defensible without the command.


Open in Devin Review

…#390)

Decision: `kbagent agent migrate-mcp-tasks` will not be built. Migrating a
scheduled `--type mcp_tool` task before v0.85.0 is manual, or AI-assisted.

The reasoning that killed automatic rewriting also argues against a
plan-generator: the parity map knows which native command replaces each tool
but not how to map arguments -- mcp_tool params are the MCP tool's own `input`
dict (`componentId`) against CLI flags (`--component-id`), with different
shapes for several tools. An agent reading `--help` next to the task's actual
input does that mapping better than any generator we could ship, and has a
human confirming. Detection already landed in #557, which is the part that
could not be improvised: `doctor` names every affected task and its
native_command, and `agent list` / serve `/agents` carry a deprecation key.

So this is documentation, not tooling:

- gotchas.md states plainly that no command exists and why, then gives the
  four-step recipe (doctor for the ids, agents.json for the input, --help for
  the flags, agent update + one agent run before trusting the cron).
- keboola-expert.md gets a one-line trigger pointing at it, kept short on
  purpose: that file is at 61.6 KB of its 62 KB budget.

Note the residual risk, since it is a judgement and not a measurement: we have
no telemetry, so "probably nobody uses this" is a call about the user base, not
an observation. If it is wrong the failure mode is a silently dead cron task --
but `kbagent doctor` now surfaces exactly that, which is why the decision is
defensible without the command.

@devin-ai-integration devin-ai-integration Bot 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.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread plugins/kbagent/skills/kbagent/references/gotchas.md Outdated
padak added 2 commits August 12, 2026 10:10
Devin review of #581, and it landed on the point of the PR: step 4 told the
reader to run `kbagent agent update <id> --type cli_command --argv ...`. That
command patches name/cron/enabled/trigger only and explicitly cannot change a
task's action, so the documented path exited 2. In a PR whose whole premise is
"a recipe instead of tooling", a recipe that fails at its last step is worse
than none.

Corrected to what works today: `agent create` the replacement, verify it with
one `agent run`, then `agent delete` the old task.

That path has a trap Devin's suggestion did not mention, so it is now spelled
out: `Trigger.task_id` chains tasks BY ID, and create-new + delete-old changes
the id. Any other task pointing at the old one via --trigger-task-id must be
repointed FIRST or the chain breaks silently.

tests/test_mcp_migration_recipe.py pins the recipe to the CLI's real flags,
including an anchor asserting `agent update` still cannot change the action --
if that ever gains --type/--argv, the test fails and the docs get simpler.
The guard I added against a broken recipe was itself broken: _options_of()
scraped `--help` to decide which flags a command has. Rendered help is a
presentation concern -- Rich wraps and truncates it by terminal width and TTY
detection -- so an option can be present in the interface and absent from the
text. It passed locally (including at COLUMNS=80) and failed on all three CI
runners.

Rather than chase what differs about the CI environment, the helper now reads
`params` off the command object, where the contract actually lives. Width and
TTY stop mattering.

Walking the tree is duck-typed on a `commands` dict rather than
isinstance(click.Group): Typer builds its own Command/Group subclasses, so the
click check is False at runtime -- which broke the first attempt at this fix.
@padak
padak merged commit 5f5fbae into main Aug 12, 2026
4 checks passed
@padak
padak deleted the docs/mcp-migration-is-manual branch August 12, 2026 08:52
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