@@ -1,38 +1,21 @@
1+- [ ] Cleanup codebase:
12
2-# TODO write cancels assistant message
3+Aggregate common helpers in packages
4+Breakdown visual tui components into their own tui files.
5+Separate modals into their own files (filesearch, keybinds, and base modal)
6+Find files larger than 750 lines write report for analysis
37
4-- Session: 017549ac3301e35884ed78aa7063ead8
8+- [ ] Encourage more subagent usage:
59
6-```
7-Error: LLM stream failed: stream request status 400:
8-{"type":"error","error":{"type":"invalid_request_error","message":"messages.38.content.1: unexpected `tool_use_id` found in `tool_result`
9-blocks: toolu_01Mq8eCePrJUNK7eQJU2MopD. Each `tool_result` block must have a corresponding `tool_use` block in the previous
10-message."},"request_id":"req_011CYArEN9fedd36dxC3Mr8i"}event: ping
11-data: {"type":"ping","cost":"0"}
12-```
10+Update the prompts so the main agent is more of an orchestrator and the subagents do code searching/editting/commands etc.
11+This makes the most of subagents for context control.
12+Teach conflict free workflows for subagents
13+Trim subagent system prompt, align it with the new encouragement, perform the task from the main agent.
14+speciallize subagent_prompt.md into separate internal agent types: Grepper, Editor, Reviewer, Tasker, Webfinder.
15+update subagent to support an optional type that uses these specialized subagent prompts, defaults to Tasker for non-specific tasks.
1316
14-Error flow:
17+- [ ] Enforce todo usage!
1518
16-Do some work, a few messages all good.
17-When work is done, last assistant message is blank, last action was a tool call to TodoWrite that returned an error.
19+- [ ] Investigate empty messages with some models
1820
19-User sends another message, all works.
20-
21-**User exits and resumes**
22-
23-Can't send new messages, see's the error above.
24-
25-FACTS:
26-
27-- Happened after a tool call with no assistant message as the last message. (this is a bug alone).
28-- Same symptoms as the other "no assistant message at the end" scenarios as:
29- - `ESC` (adds a syntetic message "User interrupted") to avoid this issue
30- - and CTRL+c which is un-addressed(but not the cause here, not used in this error flow)
31-- Before restoring, the session resumes gracefully, message ordering is correct. (in memory?)
32-- After restoring from the db, the session is broken and the error complains about missing tool calls.
33-
34-Conclusion: DB message order and "live" session message order are not a match, they aren't the same.
35-
36-Fix: Need to investigate the assistent reply with no content, what happened?, And could empty content messages with only tool calls being filtered out?
37- This same symptom was/is present when the assistant response is interrupted or the app exists with CTRL+C, maybe it's the same bug. causing the mismatch between db and live session?
38- Audit the code so the db is the source of truth, in memory only to render the TUI (with a cap as it is today)
21+- [ ] Investigate reasoning messages missing from opencode provider but working with ollama. (Check if any opencode model shows reasoning).