refactor(hooks): improve interactive bash session tracking and command parsing

- Replace regex-based session extraction with quote-aware tokenizer
- Add proper tmux global options handling (-L, -S, -f, -c, -T)
- Add normalizeSessionName to strip :window and .pane suffixes
- Add findSubcommand for proper subcommand detection
- Add early error output return to avoid false state tracking
- Fix tool-output-truncator to exclude grep/Grep from generic truncation
- Fix todo-continuation-enforcer to clear reminded state on assistant response
- Add proper parallel stdout/stderr reading in interactive_bash tool
- Improve error handling with proper exit code checking

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-15 19:02:31 +09:00
parent c2e96f1ffe
commit 03a450131d
4 changed files with 207 additions and 26 deletions

View File

@@ -1,9 +1,8 @@
import type { PluginInput } from "@opencode-ai/plugin"
import { createDynamicTruncator } from "../shared/dynamic-truncator"
// Note: "grep" and "Grep" are handled by dedicated grep-output-truncator.ts
const TRUNCATABLE_TOOLS = [
"grep",
"Grep",
"safe_grep",
"glob",
"Glob",