Skip to content

fix(trae): support Trae CLI Next hooks#266

Merged
wxtsky merged 1 commit into
wxtsky:mainfrom
Hayak3:fix-trae-cli-next-hooks
Jul 23, 2026
Merged

fix(trae): support Trae CLI Next hooks#266
wxtsky merged 1 commit into
wxtsky:mainfrom
Hayak3:fix-trae-cli-next-hooks

Conversation

@Hayak3

@Hayak3 Hayak3 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Keep legacy Trae IDE hooks at ~/.trae/hooks.json
  • Add separate Trae CLI Next hooks at ~/.trae/cli/hooks.json
  • Use TraeX-supported PascalCase hook events for Trae CLI Next instead of legacy Trae IDE events like beforeReadFile
  • Clean up CodeIsland-managed legacy Trae IDE entries if they were written into the new Trae CLI Next hooks file

Background

Trae CLI Next no longer reads ~/.trae/hooks.json. It reads ~/.trae/cli/hooks.json, but that file must use the TraeX hook event schema. Reusing the old Trae IDE event list causes parse errors such as:

unknown hook event: "beforeReadFile"

Verification

  • swift build -c release passed
  • git diff --check passed
  • swift test --filter ... could not run on this machine because the active developer directory is CommandLineTools and XCTest is unavailable; debug test builds also hit an existing SwiftUI #Preview / PreviewsMacros
    environment issue

@wxtsky
wxtsky force-pushed the fix-trae-cli-next-hooks branch from d243905 to 0ada7f2 Compare July 23, 2026 04:06
@wxtsky
wxtsky merged commit 8287a78 into wxtsky:main Jul 23, 2026
wxtsky added a commit that referenced this pull request Jul 23, 2026
- traecli-next settings row now shows the Trae icon (#266 review)
- fix missing backslash in codex meta test filename interpolation (#267 review)
- note that turn_failed is a forward-compatible guess, absent from today's
  codex EventMsg enum (#267 review)
- probe ~/.config/claude (ccusage-style default) ahead of
  ~/.config/claude-code in the XDG rung, with test (#270 review)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wxtsky

wxtsky commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Merged (8287a78) — thanks! Contract verification went deep on this one: the 13 PascalCase event names, SessionEnd (not SessionStop), and optional-matcher semantics all checked out against independent sources. Two notes:

  1. I added the traecli-next → Trae icon mapping on main in a follow-up commit (1d92797).
  2. The one thing we could not independently corroborate anywhere is the ~/.trae/cli/hooks.json path itself (your unknown hook event: "beforeReadFile" error output is currently the only evidence this build exists). Could you share which Trae CLI version/build reads this file (trae --version or a changelog link)? Worst case it's a benign no-op — install is gated on ~/.trae/cli existing — but it would be good to have on record.

@Hayak3

Hayak3 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Merged (8287a78) — thanks! Contract verification went deep on this one: the 13 PascalCase event names, SessionEnd (not SessionStop), and optional-matcher semantics all checked out against independent sources. Two notes:

  1. I added the traecli-next → Trae icon mapping on main in a follow-up commit (1d92797).
  2. The one thing we could not independently corroborate anywhere is the ~/.trae/cli/hooks.json path itself (your unknown hook event: "beforeReadFile" error output is currently the only evidence this build exists). Could you share which Trae CLI version/build reads this file (trae --version or a changelog link)? Worst case it's a benign no-op — install is gated on ~/.trae/cli existing — but it would be good to have on record.

traecli 0.200.19(internal edition) it is internal version, and will be release soon

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.

2 participants