Skip to content

Commit 1c6dc9e

Browse files
committed
docs: add research notes and planning docs
- Cline subagent architecture research questions - UI/UX overhaul plan - Escape key UX research
1 parent 2d82390 commit 1c6dc9e

3 files changed

Lines changed: 133 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Research: Cline Subagent Architecture
2+
3+
**Date:** 2026-02-24
4+
**Status:** TODO — pick up in next session
5+
6+
## Research Questions
7+
8+
1. How does Cline form subagents? How does the AI decide how many to create?
9+
2. What task distribution strategy is used? How are tasks assigned to each subagent?
10+
3. How is context shared between parent agent and subagents?
11+
4. How are subagent outputs aggregated back into the main conversation?
12+
5. What happens when a subagent task errors? Error handling and recovery.
13+
6. How could this inspire improvements to opencode's existing subagent system?
14+
15+
## Key References
16+
17+
- **CLI Subagent Command Transformation**: `src/integrations/cli-subagents/subagent_command.ts`
18+
- `isSubagentCommand()` — identifies simplified cline commands
19+
- `transformClineCommand()` — injects `--json -y` flags for autonomous execution
20+
21+
- **Agent Client Protocol (ACP)**: `cli/src/acp/AcpAgent.ts`
22+
- Bridges ClineAgent with AgentSideConnection for stdio-based communication
23+
- Handles permission requests, forwards session events
24+
25+
- **ClineAgent**: `cli/src/agent/ClineAgent.ts`
26+
- Implements ACP agent interface
27+
- Translates ACP requests into core Controller operations
28+
- Manages authentication, session modes, processes user prompts
29+
30+
- **Message Translator**: `cli/src/agent/messageTranslator.ts`
31+
- Converts ClineMessage objects to ACP SessionUpdate messages
32+
- Computes deltas for streaming (avoids duplicate content)
33+
34+
## CodeWiki References
35+
36+
- https://codewiki.google/github.com/cline/cline#cli-subagent-command-transformation
37+
- https://codewiki.google/github.com/cline/cline#command-line-interface-cli-functionality
38+
- https://codewiki.google/github.com/cline/cline#agent-client-protocol-acp-integration-for-external-control
39+
40+
## Comparison with OpenCode's Subagent System
41+
42+
OpenCode already has subagents (`TaskTool` in `packages/opencode/src/tool/task.ts`):
43+
- Subagents are spawned via the `task` tool
44+
- Each subagent gets its own child session
45+
- Subagent types: explore, plan, general (configurable per agent)
46+
- Results returned as tool output to parent session
47+
48+
**Gaps to investigate:**
49+
- Does Cline support parallel subagents? (OpenCode does via plan mode Phase 1)
50+
- How does Cline's ACP protocol compare to opencode's Bus event system?
51+
- Can we adopt Cline's streaming delta pattern for subagent updates?
52+
53+
## Tonight's Session Summary (2026-02-24, 2:37 AM - 4:57 AM)
54+
55+
### 6 PRs Submitted to opencode (sst/opencode):
56+
1. **#14820** — Streaming content duplication fix (global-sdk.tsx voided Set)
57+
2. **#14821** — Font size settings (CSS vars + terminal + UI stepper)
58+
3. **#14826** — ContextOverflowError auto-recovery (processor.ts)
59+
4. **#14827** — Prune before compaction (prompt.ts)
60+
5. **#14831** — Context usage card with compact button (session-context-tab.tsx)
61+
6. **#14835** — Wide mode setting (full-width chat toggle)
62+
63+
### Issues Created:
64+
- #14822, #14823, #14824, #14825, #14830, #14834
65+
66+
### All branches merged into `origin/dev` on fork (PrakharMNNIT/opencode)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Research: Escape Key Cancel UX
2+
3+
**Date:** 2026-02-24
4+
**Status:** TODO — brainstorm in next session
5+
6+
## Problem
7+
Pressing Escape accidentally during AI response immediately stops the response with no confirmation. No visual feedback in chat that response was interrupted.
8+
9+
## Current Behavior
10+
- Escape → immediately cancels the LLM response
11+
- Shows a notification/warning toast
12+
- No visual indicator in the chat thread that the message was interrupted
13+
- No confirmation dialog before cancelling
14+
15+
## User's Proposed Improvements
16+
1. **Confirmation before cancel** — Alert/dialog: "Are you sure you want to interrupt?"
17+
2. **Visual interruption indicator** — Show in chat that the message was interrupted (red line, badge, etc.)
18+
3. **Better UX** — Maybe double-tap Escape to cancel, or Escape once to show warning
19+
20+
## Files to Investigate
21+
- `packages/app/src/pages/session.tsx` — handleKeyDown, Escape handling
22+
- `packages/app/src/components/prompt-input.tsx` — Escape key handling in input
23+
- `packages/opencode/src/session/prompt.ts` — cancel() function
24+
- `packages/ui/src/components/message-part.tsx` — interrupted state rendering
25+
- `packages/app/src/pages/session/use-session-commands.tsx` — session.cancel command
26+
27+
## Design Questions
28+
1. Should Escape require double-tap? (like VS Code terminal)
29+
2. Should there be a small "Esc to cancel" indicator during streaming?
30+
3. Should interrupted messages have a visual indicator (red border/badge)?
31+
4. Should there be an "undo cancel" option (resume if possible)?
32+
5. How does Cline/Cursor handle this?

docs/09-temp/ui-overhaul-plan.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# UI/UX Overhaul Plan — OpenCode Desktop
2+
3+
**Date:** 2026-02-24
4+
**Status:** TODO — needs brainstorming session with ui-ux-pro-max + frontend-pe skills
5+
6+
## User Requirements
7+
- UI looks "very bad" — needs visual polish and tactile feel
8+
- More themes and theme customization
9+
- Better UI rendering quality
10+
- Font size ✅ (fixed in PR #14821)
11+
- Zoom in/out ✅ (already works via Cmd+/-/0)
12+
- Wide mode ✅ (added in PR #14835)
13+
- More UI settings options needed
14+
15+
## Skills to Use
16+
- `ui-ux-pro-max` — Design system, color palettes, typography, UX guidelines
17+
- `frontend-pe` — Avant-garde UI design, micro-interactions, visual polish
18+
- `brainstorming` — Plan before implementing
19+
20+
## Areas to Investigate
21+
1. **Theme system** — opencode already has theming (`packages/ui/src/context/theme/`). How to add more?
22+
2. **Tactile UI** — Micro-interactions, hover states, transitions, shadows
23+
3. **Typography** — Font rendering, line-height, letter-spacing refinements
24+
4. **Spacing** — Consistent padding/margin system
25+
5. **Colors** — More vibrant palettes, better contrast
26+
6. **Animations** — Smooth transitions between states
27+
7. **Settings page** — More appearance options (line-height, letter-spacing, sidebar width, etc.)
28+
29+
## Tonight's Completed Fixes (6 PRs)
30+
- #14820: Streaming content duplication
31+
- #14821: Font size settings (CSS + terminal + UI)
32+
- #14826: ContextOverflowError recovery
33+
- #14827: Prune before compaction
34+
- #14831: Context usage card + compact button
35+
- #14835: Wide mode setting (full-width chat)

0 commit comments

Comments
 (0)