MCP PostToolUse: verify tool_response format for merge fast-forward hook #21

Closed
opened 2026-02-24 19:44:01 +00:00 by forgejo_admin · 0 comments
Contributor

Context

post-mcp-merge-rebase.sh checks .tool_response.merged via jq. But forgejo-mcp returns a JSON string via json.dumps(), so tool_response might be a raw string (not a parsed object), making .merged return null.

Impact

Fail-safe: hook silently exits without fast-forwarding local main. No breakage, but defeats the purpose.

Suggested fix

Test an actual MCP merge to see the PostToolUse stdin format. Then either:

  • Parse the string with fromjson if it's a raw string
  • Or confirm it's already parsed and the current code works

Discovered in

PR #17 review, round 2

## Context `post-mcp-merge-rebase.sh` checks `.tool_response.merged` via jq. But forgejo-mcp returns a JSON string via `json.dumps()`, so `tool_response` might be a raw string (not a parsed object), making `.merged` return null. ## Impact Fail-safe: hook silently exits without fast-forwarding local main. No breakage, but defeats the purpose. ## Suggested fix Test an actual MCP merge to see the PostToolUse stdin format. Then either: - Parse the string with `fromjson` if it's a raw string - Or confirm it's already parsed and the current code works ## Discovered in PR #17 review, round 2
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/claude-custom#21
No description provided.