Work through TODO fixes #8
Reference in New Issue
Block a user
Delete Branch "todo-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Works through the outstanding
TODO.mditems. Each fix was implemented by a codex sub-agent driven through patterm's own MCP (orchestrator + sub-agent dogfooding) and reviewed before commit. One commit per issue.Fixed
handleConndispatched requests serially, so a slow tool (wait_for_pattern, up to 300s) monopolized the single per-agent connection and queued calls (get_process_status) timed out behind it. Requests are now handled per-goroutine with serialized writes and aWaitGroupfor graceful teardown. (7b5a226)agent-closesent a single SIGTERM with no escalation, so an agent that traps SIGTERM (e.g. opencode) stayed in the tab bar until closed again. AddedSession.Terminate(SIGTERM → wait → SIGKILL, entry preserved) run from the close handler in a goroutine. (50fd7be)osc_title_stability, but draws progress in the pane body, so its stable title made the classifier call it idle while working. Added a(?i)esc to interruptthinking-promoter to the codex preset so it staysthinkinguntil the turn's footer disappears. (0725375)writeInputvia a purepieceWriteDelay), covering send_input/send_message/timers/spawn-prompt. (178b443)Added
scratchpad_deleteMCP tool — mirrors the existing scratchpad tools end-to-end (catalog, dispatch, host method delegating toscratchpad.Store.Delete, sidebar refresh). (96f7c66)Changed
get_process_outputwhitespace-normalized —normalizeGridTextstrips trailing per-line whitespace, collapses blank runs, and normalizes line endings, cutting token waste from padded grid rows. Stream/raw output andwait_for_patternmatching untouched. (53f06b6)d2342f9)Verification
go build ./...,go vet ./..., all unit tests, and the full harness E2E suite pass.pieceWriteDelay,normalizeGridText,scratchpad_deleteround-trip,summaryTextFor).Caveat — needs a rebuild to confirm live
Two changes are deterministic in code and unit-tested, but their real-world effect can only be confirmed after rebuilding + restarting patterm (the session they were developed in ran the old binary):
178b443) — a timing heuristic against codex's paste detector;d2342f9).Codex uses the osc_title_stability idle strategy, but it draws its progress in the pane body ('Working … esc to interrupt'), not the OSC title. The title goes stable mid-turn, so ~2s later the classifier declared codex idle while it was still working. Add a thinking-promoter pattern ((?i)esc to interrupt) to the codex built-in preset; classify() checks promoter regexes against the rendered screen before the title-stability verdict, so codex stays in thinking until the turn's in-progress footer actually disappears. Resolves the [CODEX IDLE] TODO item.