fix(integrations): Cline overrides post_process_command_content (correct hook name)#3657
Merged
mnriem merged 1 commit intoJul 22, 2026
Conversation
…ect hook name) ClineIntegration defined its command-content transform as post_process_content, but the overridable base hook is IntegrationBase.post_process_command_content, which CommandRegistrar.register_commands() dispatches to for every non-skills integration. Because the names differed, Cline's method never overrode the base hook, so extension/preset command files registered for Cline silently ran the base no-op and never received Cline's dot-to-hyphen hook-command note (_inject_hook_command_note) — the note that tells the agent to replace dots with hyphens when invoking hook commands. (Handoff references are already hyphenated independently by the registrar's _hyphenate_body_refs, so that transform was unaffected; renaming simply makes Cline's own copy run too, harmlessly, since both are idempotent.) Rename to post_process_command_content (matching the base hook and the post_process_skill_content convention used by claude/copilot/agy/kimi/ droid/vibe) and update the single internal caller in setup(). Cline's own setup() post-processing of core commands is unchanged. No test referenced the old name. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Cline post-processing for extension and preset commands by overriding the registrar’s correct hook.
Changes:
- Renames the Cline hook and updates its setup caller.
- Adds regression coverage for registrar-applied Cline transforms.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/integrations/cline/__init__.py |
Corrects the post-processing hook override. |
tests/test_post_process.py |
Tests real Cline transforms through CommandRegistrar. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Medium
Collaborator
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ClineIntegrationdefined its command-content transform aspost_process_content, but the overridable base hook isIntegrationBase.post_process_command_content— the methodCommandRegistrar.register_commands()dispatches to (agents.py:813and:877) for every non-skills integration.Because the names differed, Cline's method never overrode the base hook. For extension/preset command files registered via
CommandRegistrar, the registrar therefore ran the base no-op, so those files never received Cline's dot-to-hyphen hook-command note (_inject_hook_command_note) — the note instructing the agent to replace dots with hyphens when invoking hook commands.(Cline's own
setup()still works because it calls the method directly. And handoff references are already hyphenated independently by the registrar's_hyphenate_body_refs, so that transform was unaffected — renaming just makes Cline's own copy run too, harmlessly, since both are idempotent.)Fix
Rename
post_process_content→post_process_command_content(matching the base hook and thepost_process_skill_contentexact-name-override convention used by claude/copilot/agy/kimi/droid/vibe), and update the single internal caller insetup(). No test referenced the old name.Tests
tests/test_post_process.py::TestClineRealPostProcess::test_cline_transforms_applied_via_registrar— registers an extension command throughCommandRegistrarand asserts Cline's real transform ran (the hook-command note's "replace dots" text is present). Fails before the fix (note absent — the base no-op ran); passes after.ruffclean; all 11 post-process tests pass.AI-assisted: authored with Claude Code. I traced the registrar dispatch (
post_process_command_contentat agents.py:813/877), confirmed the exact-name-override convention across sibling integrations, and verified via fail-before that the hook-command note is missing without the rename.