Skip to content

refactor(hooks): host capability table instead of nested isX branches - #1380

Open
tldagent wants to merge 1 commit into
DietrichGebert:mainfrom
tldagent:chore/host-adapter-mode-tracker
Open

tldagent wants to merge 1 commit into
DietrichGebert:mainfrom
tldagent:chore/host-adapter-mode-tracker

Conversation

@tldagent

@tldagent tldagent commented Nov 9, 2026

Copy link
Copy Markdown

Summary

  • Add hooks/ponytail-host.js with resolveHost() capability flags for Claude, Qoder, Cursor, Codex, Copilot, and CodeBuddy.
  • Rewrite ponytail-mode-tracker.js and ponytail-activate.js to branch on those flags instead of nesting isQoder / isCursor / isCodex checks.
  • Behavior unchanged: existing hook/Qoder/Cursor/Windows tests still pass; new tests/host-adapter.test.js locks the capability table and the no-nest regression.

Follow-up to the clean-code review on #1379 (host branching in the hot path).

Test plan

  • node --test tests/host-adapter.test.js
  • node --test tests/hooks.test.js
  • node --test tests/hooks-windows.test.js
  • node --test tests/cursor-hooks.test.js tests/qoder-plugin.test.js
  • CI green on this PR

Made with Cursor

Mode tracking and SessionStart activation read named capabilities from
resolveHost() (inject every prompt, fold notices, deliver ruleset on switch,
band, statusline nudge, always-on Cursor rule) so adding a host is a row in
ponytail-host.js rather than more isQoder/isCursor nests in the hot path.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant