plan_rebase
Read what rebasing an agent's worktree onto its base would do, without moving anything.
AgentwritesidempotentMCP tool
Call this before rebase_worktree, every time: it names the ref and the commit the branch would land on, how many of the agent's own commits would be replayed, how many the base already holds whole and so would be dropped, how many merge commits a rebase would flatten away, and the paths a merge of the base could not settle. Those paths are a warning rather than a verdict, since a rebase replays commit by commit and can conflict where a merge would not. This refuses for the same reasons rebase_worktree does, so it is also how you find out whether a rebase is possible at all without attempting one.
Calling it#
curl -X POST http://127.0.0.1:8787/agent.v1.AgentService/PlanRebase \
-H 'Content-Type: application/json' \
-d '{
"agentId": "<agentId>"
}'komrad rpc plan-rebase \
--agent-id <string>{
"name": "plan_rebase",
"arguments": {
"agentId": "<agentId>"
}
}Offered by the komrad MCP server to orchestrator agents.
Request#
PlanRebaseRequest#
PlanRebaseRequest asks what a rebase would do without doing it, which is what the confirmation names.
| Field | Type | Description |
|---|---|---|
agentId | string | Whose branch the rebase would move. required |
Response#
PlanRebaseResponse#
| Field | Type | Description |
|---|---|---|
baseRef | string | The ref the branch would move onto, and the commit that ref named when it was read, so a person is told which commit was used rather than only which branch. |
baseSha | string | The commit that ref named when it was read. |
commits | int32 | How many of the agent's own commits would be replayed. |
branch | string | Which branch would move. |
landedCommits | int32 | How many of the agent's own commits the base already holds whole, which is what a merge of its work into the base leaves behind, and how many are left to replay. |
replayCommits | int32 | How many are left to replay onto the new base. |
merges | int32 | How many merge commits a rebase would discard, since it flattens history. |
conflictPaths | list of string | The paths a merge of the base into the branch could not settle, which is a warning rather than a verdict: a rebase replays commit by commit and can conflict where a merge would not. |