Description
Some LLM models (e.g., MiniMax M2.7) don't reliably call the github_comment tool at the end of their run, leaving GitHub issues/PRs without a response even though the agent successfully completed the task.
Problem
When using non-Anthropic models, the agent may:
- Successfully process the request
- Generate a valid response
- But never call
github_comment to post the result back
The user sees no response on GitHub even though the agent worked correctly.
Proposed Solution
An @after_agent middleware that acts as a safety net:
- Checks if the source is
"github"
- Checks if the agent already called
github_comment (if so, does nothing)
- Collects all AI text messages from the current run (since last human message)
- Strips
<think> blocks (used by some models for chain-of-thought)
- Posts the collected text as a GitHub comment
This is a no-op when the model correctly calls github_comment on its own, so it's safe to include in the middleware chain for all models.
Key design decisions:
- Scoped to current run only (
_messages_since_last_human) to avoid reposting from previous runs
- No filtering of message types — all AI text is included
- Strips
<think>...</think> reasoning blocks that some models embed
I have a PR ready with the implementation and 24 tests.
Description
Some LLM models (e.g., MiniMax M2.7) don't reliably call the
github_commenttool at the end of their run, leaving GitHub issues/PRs without a response even though the agent successfully completed the task.Problem
When using non-Anthropic models, the agent may:
github_commentto post the result backThe user sees no response on GitHub even though the agent worked correctly.
Proposed Solution
An
@after_agentmiddleware that acts as a safety net:"github"github_comment(if so, does nothing)<think>blocks (used by some models for chain-of-thought)This is a no-op when the model correctly calls
github_commenton its own, so it's safe to include in the middleware chain for all models.Key design decisions:
_messages_since_last_human) to avoid reposting from previous runs<think>...</think>reasoning blocks that some models embedI have a PR ready with the implementation and 24 tests.