You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Input normalization: normalizeCodeEditInput() strips markdown fences from LLM-wrapped code_edit to prevent Morph API confusion
Marker leakage guard: Post-merge validation detects when Morph treats // ... existing code ... markers as literal text instead of expanding them — aborts file write and returns actionable error
Catastrophic truncation guard: Dual-metric validation (>60% char loss AND >50% line loss) prevents silent data loss from failed merges
Structured error recovery: Guard failures include specific metrics, explanations, and 3 actionable recovery options
TUI titles for guard failures: tool.execute.after hook now shows branded titles like Morph: blocked (marker leakage) and Morph: blocked (truncation)
Test suite: 32 tests covering normalization, marker leakage logic, and truncation detection edge cases
CI: GitHub Actions for test/typecheck on push and automated releases on tags
Changed
EXISTING_CODE_MARKER constant: Extracted to module-level constant (no longer exported) for consistency and testability
Guard logging: Both post-merge guards emit diagnostic warn-level logs before returning errors
Hardcoded marker strings: All references to "// ... existing code ..." now use the EXISTING_CODE_MARKER constant
Fixed
Plugin loader crash: Removed unnecessary named exports (EXISTING_CODE_MARKER, normalizeCodeEditInput, MorphFastApply) that caused OpenCode's plugin loader to crash when iterating exports and calling a string as a function. Only export default MorphFastApply remains.
Consistent formatting: Applied semicolons and trailing commas throughout for code style consistency