Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.trytrellis.app/llms.txt

Use this file to discover all available pages before exploring further.

Fix SessionStart hook crash on Python ≤3.11 (SyntaxError: f-string expression part cannot include a backslash). No new migrations.

Bug Fixes

Hook session-start: PEP 498 f-string backslash in Python ≤3.11

The Windows path normalizer added in 0.5.0-rc.6 (#226) used:
return f"{drive}:\\{rest.replace('/', '\\')}"
PEP 498 forbids backslashes inside f-string expression parts. On Python ≤3.11 the file fails to parse, and the hook exits with code 1 before running:
SessionStart hook (failed)
error: hook exited with code 1
PEP 701 in Python 3.12 lifted the restriction, so the bug was invisible to 3.12+ users. Codex CLI 0.128 + Trellis 0.5.0 reproduced it in the field. Fixed by lifting the .replace(...) call out of each f-string expression into a local variable. 9 occurrences across:
  • packages/cli/src/templates/codex/hooks/session-start.py
  • packages/cli/src/templates/copilot/hooks/session-start.py
  • packages/cli/src/templates/shared-hooks/session-start.py (Claude Code / Cursor / Gemini CLI / Qoder / CodeBuddy / Factory Droid / Kiro)
Added regression coverage in packages/cli/test/regression.test.ts: regex scan asserts no f-string contains a backslash inside {...} expressions, plus a best-effort python3 -c "ast.parse(...)" pass.

Upgrade

npm install -g @mindfoldhq/trellis@latest
trellis update