Skip to content

fix(integrations): Cline overrides post_process_command_content (correct hook name)#3657

Merged
mnriem merged 1 commit into
github:mainfrom
jawwad-ali:fix/cline-post-process-command-content-override
Jul 22, 2026
Merged

fix(integrations): Cline overrides post_process_command_content (correct hook name)#3657
mnriem merged 1 commit into
github:mainfrom
jawwad-ali:fix/cline-post-process-command-content-override

Conversation

@jawwad-ali

Copy link
Copy Markdown
Contributor

What

ClineIntegration defined its command-content transform as post_process_content, but the overridable base hook is IntegrationBase.post_process_command_content — the method CommandRegistrar.register_commands() dispatches to (agents.py:813 and :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_contentpost_process_command_content (matching the base hook and the post_process_skill_content exact-name-override convention used by claude/copilot/agy/kimi/droid/vibe), and update the single internal caller in setup(). No test referenced the old name.

Tests

tests/test_post_process.py::TestClineRealPostProcess::test_cline_transforms_applied_via_registrar — registers an extension command through CommandRegistrar and 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. ruff clean; all 11 post-process tests pass.


AI-assisted: authored with Claude Code. I traced the registrar dispatch (post_process_command_content at 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.

…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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@mnriem
mnriem merged commit 38eb2fc into github:main Jul 22, 2026
14 checks passed
@mnriem

mnriem commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

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.

3 participants