5 Commits

Author SHA1 Message Date
can1357 12115e4cdf fix(utils): excluded ASCII replacements inside HTML comments
- Added an HTML comment state tracker to prompt formatting.
- Updated ASCII symbol replacement to skip substitutions inside `<!-- ... -->` comment blocks across lines.
- Added tests that preserved comment text while converting symbols outside comments.
2026-05-14 06:40:50 +02:00
can1357 a21a542afd refactor(prompt-templates): migrated prompt utilities to pi-utils package
- Extracted prompt rendering and formatting utilities from coding-agent to centralized pi-utils package with new API surface (prompt.render, prompt.format, prompt.registerHelper).
- Migrated parseFrontmatter utility from coding-agent to pi-utils package; updated 8 files to import from @oh-my-pi/pi-utils.
- Removed 170-line prompt-format.ts module and consolidated 192 lines of Handlebars helper registrations into pi-utils prompt module.
- Updated 60+ files across coding-agent and typescript-edit-benchmark to use new prompt.render() and prompt.format() API from pi-utils.
- Simplified prompt-templates.ts by delegating core functionality to pi-utils while retaining custom helper registrations (jtdToTypeScript, jsonStringify, etc.).
2026-04-08 05:47:35 +02:00
can1357 5347d89e76 fix(coding-agent): corrected variable initialization order in formatPromptContent
- Corrected variable initialization order in formatPromptContent to prevent stale trimmedStart value when ASCII symbol replacement occurs.
- Updated bash.md documentation to use ellipsis (...) instead of three dots (...) for consistency with ASCII symbol replacement behavior.
- Added test case verifying table row compaction and content deduplication during pre-render with ASCII symbol replacement.
2026-03-01 11:21:17 +01:00
can1357 3321cb8061 feat(coding-agent): enforced tool decision requirement in plan mode
- Enforced tool decision in plan mode--agent now requires calling either `ask` or `exit_plan_mode` when a turn ends without a required tool call.
- Fixed cancellation behavior of `ask` tool to abort the current turn instead of returning a normal cancelled selection, while timeout-driven auto-cancel still returns without aborting.
- Added plan-mode-tool-decision-reminder system prompt to guide agent when required tools are not called.
- Improved agent_end event handling to use fallback assistant message when #lastAssistantMessage is unavailable.
2026-03-01 11:16:54 +01:00
can1357 7de4c831e6 refactor(coding-agent): extracted prompt formatting into reusable utility
- Extracted prompt formatting logic into reusable `formatPromptContent()` utility function with configurable render phases.
- Removed 166 lines of duplicate formatting code from scripts and config modules by centralizing regex patterns and helper functions.
- Updated prompt template rendering to use unified `formatPromptContent()` instead of inline `optimizePromptLayout()` implementation.
- Added comprehensive test coverage for prompt formatting with pre-render and post-render mode validation.
2026-02-28 05:27:46 +01:00