Repository navigation
Closed
Closed
Copy link
Labels
discussionUsed for feature requests, proposals, ideas, etc. Open discussionUsed for feature requests, proposals, ideas, etc. Open discussionneeds:complianceThis means the issue will auto-close after 2 hours.This means the issue will auto-close after 2 hours.opentuiThis relates to changes in v1.0, now that opencode uses opentuiThis relates to changes in v1.0, now that opencode uses opentui
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem Description
OpenCode currently has the following limitations when managing sub-agent sessions:
- No Auto-Discovery Mechanism - The bottom bar/status line does not automatically display sub-session count and status
- Inefficient Manual Switching - Requires
<leader>right/leftto cycle through sessions one by one - No Auto-Switch Support - Focus does not automatically switch when sub-tasks are created or completed
- Poor Status Visibility - Cannot quickly identify which sub-session is awaiting permission or has completed
Current Status Analysis
Session Navigation Capabilities
| Feature | Status | Issue/PR |
|---|---|---|
| Manual Cycle Switch | ✅ Supported | Built-in |
| Dialog Picker | 🔄 In Progress | #6183 / PR #6184 |
| Sidebar Display | 🔄 Partial | #5242 / PR #4865 |
| Tab Bar Navigation | 🟢 Discussion | #5826 |
| Tree Manager | 🟢 Discussion | #6032 |
Auto-Switch Capabilities
| Feature | Status | Issue |
|---|---|---|
| Auto-Switch on Sub-Task Create | ❌ Not Supported | #6282 (Closed) |
| Auto-Return on Sub-Task Complete | ❌ Not Supported | #6282 (Closed) |
| Auto-Focus on Permission Request | ❌ Not Supported | - |
Status Display Capabilities
| Feature | Status | Issue |
|---|---|---|
| Background Task Status | 🔄 In Progress | #8322 |
| Running Tools & LLM Status | 🔄 In Progress | #9655 |
| Sub-Agent Info (ACP) | 🟢 Requested | #11576 |
Proposed Solution
Option 1: Bottom Bar Auto-Discovery + Quick Switch (Recommended)
1. Bottom Bar Auto-Discovery of Sub-Sessions
Automatically display sub-session summary in the status line:
┌─────────────────────────────────────────────────┐
│ [conversation content] │
│ > prompt input │
├─────────────────────────────────────────────────┤
│ build │ claude-sonnet │ 3 sub[1⏳ 2✓] │ $0.02 │
└─────────────────────────────────────────────────┘
Display Content:
- Total sub-session count
- Permission pending count (⏳)
- Completed count (✓)
- Active/busy count (⟳)
2. Click/Shortcut Quick Switch
// Configuration Example
{
"tui": {
"status_line": {
"subsession": {
"enabled": true,
"click_action": "switch_next",
"shortcuts": {
"switch_next": "ctrl+]",
"switch_prev": "ctrl+[",
"switch_picker": "<leader>s",
"auto_switch": true
}
}
}
}
}3. Auto-Switch Rules
// Auto-Switch Configuration
{
"subsession": {
"auto_switch": {
"on_create": true, // Auto-switch when sub-session created
"on_permission": true, // Auto-focus when sub-session awaits permission
"on_complete": true, // Auto-return to parent when sub-session completes
"on_error": false, // Switch on sub-session error
"exclude_agents": [] // Exclude specific agent types
}
}
}4. Plugin API Extension
// Plugin Sub-Session Event Subscription
export type PluginInput = {
// ... existing fields
subsession: {
// Get child sessions of current session
list: () => Promise<SubSessionInfo[]>;
// Switch to specific sub-session
switch: (sessionID: string) => Promise<void>;
// Get parent session
getParent: () => Promise<SessionInfo | null>;
// Subscribe to sub-session changes
on: (event: 'created' | 'updated' | 'deleted' | 'permission',
handler: (info: SubSessionInfo) => void) => void;
}
}
interface SubSessionInfo {
sessionID: string;
parentID: string;
agent: string;
status: 'idle' | 'busy' | 'permission_pending' | 'completed' | 'error';
createdAt: number;
updatedAt: number;
title?: string;
}Option 2: Complete Session Management System
Reference #6032 Nerdtree style, implement full tree session manager:
Sessions (Sidebar)
├─ ● Main Session (build)
│ ├─ ◉ explore-task (waiting permission)
│ ├─ ✓ code-review (completed)
│ └─ ⟳ write-tests (busy)
└─ ○ Other Session (plan)
Option 3: Tab Bar Navigation
Reference #5826, implement horizontal tab bar:
[Main ●] [explore ◉] [review ✓] [tests ⟳] [+ ]
Use Cases
Use Case 1: Parallel Multi-Task Development
User launches multiple sub-tasks:
1. Frontend development task
2. Backend API task
3. Test writing task
Bottom bar displays: 3 sub [1⏳ 1⟳ 1✓]
User can quickly switch to check each task's progress
Use Case 2: Permission Request Auto-Focus
When sub-session needs permission confirmation:
- Auto-switch to that sub-session
- Bottom bar highlights ⏳ icon
- Auto-return to original session after user confirmation
Use Case 3: Plugin Sub-Task Monitoring
export const SubSessionMonitor = async ({ client }) => {
client.subsession.on('permission', (info) => {
client.tui.showToast({
message: `Sub-task "${info.title}" requires permission`,
variant: 'warning'
});
});
client.subsession.on('complete', (info) => {
// Log sub-task completion metrics
logSubSessionMetrics(info);
});
};Benefits
- Efficiency Improvement - Reduce session switching time by 70%+
- Status Visibility - Real-time awareness of all sub-session states
- Automation - Reduce manual operations, focus on core tasks
- Plugin-Friendly - Provide complete API for plugin extension
- Backward Compatible - Optional feature, does not affect existing workflows
Technical Implementation Suggestions
1. Status Line Integration
// packages/tui/src/status-line.ts
function renderSubSessionInfo() {
const children = sync.session.getChildren(currentSessionID);
const stats = {
total: children.length,
permission: children.filter(c => hasPermissionPending(c.id)).length,
busy: children.filter(c => isBusy(c.id)).length,
completed: children.filter(c => isCompleted(c.id)).length,
};
return `${stats.total} sub[${stats.permission}⏳ ${stats.completed}✓]`;
}2. Auto-Switch Logic
// packages/opencode/src/session/switch.ts
async function handleSubSessionEvent(event: SubSessionEvent) {
const config = await getConfig();
if (event.type === 'permission' && config.subsession.auto_switch.on_permission) {
await switchToSession(event.sessionID);
}
if (event.type === 'complete' && config.subsession.auto_switch.on_complete) {
const parent = await getSession(event.sessionID).parentID;
if (parent) await switchToSession(parent);
}
}3. Plugin Event Subscription
// packages/plugin/src/hooks.ts
export const SessionHooks = {
'subsession.created': async (info: SubSessionInfo) => { ... },
'subsession.updated': async (info: SubSessionInfo) => { ... },
'subsession.deleted': async (info: SubSessionInfo) => { ... },
'subsession.permission': async (info: SubSessionInfo) => { ... },
};Related Issues
- Add interactive session switcher for navigating between subagent sessions #6183 - Add interactive session switcher for navigating between subagent sessions
- [FEATURE]: Auto Subtask switching #6282 - Auto Subtask switching (closed as duplicate of Custom commands with agents should(?) change to the agent session. #3329)
- [FEATURE]: dedicated subaagents' sidebar #5242 - dedicated subaagents' sidebar
- Feature Request: Agent Session Tab Bar Navigation #5826 - Agent Session Tab Bar Navigation
- [FEATURE]: Nerdtree like session manager #6032 - Nerdtree like session manager
- feat: Show background tasks status in sidebar #8322 - Show background tasks status in sidebar
- feat(tui): show running tools and LLM status in sidebar #9655 - show running tools and LLM status in sidebar
- [FEATURE]: Support subagent information in ACP #11576 - Support subagent information in ACP
- feat(task): Add subagent-to-subagent delegation with budgets, persistent sessions, and hierarchical session navigation #7756 - subagent-to-subagent delegation with hierarchical navigation (PR)
- Custom commands with agents should(?) change to the agent session. #3329 - Custom commands with agents should change to the agent session
Priority Recommendations
- High Priority: Bottom bar sub-session status display + shortcut switching
- Medium Priority: Auto-switch rules (create/permission/complete)
- Low Priority: Plugin API extension + complete tree manager
Configuration Example
{
"$schema": "https://opencode.ai/config.json",
"tui": {
"status_line": {
"enabled": true,
"subsession": {
"enabled": true,
"format": "{total} sub[{permission}⏳ {completed}✓]",
"auto_switch": {
"on_create": false,
"on_permission": true,
"on_complete": true
}
}
}
}
}References
- Claude Code sub-task management
- VS Code terminal tab management
- tmux/screen session management
- kitty terminal tab system
Metadata
Metadata
Assignees
Labels
discussionUsed for feature requests, proposals, ideas, etc. Open discussionUsed for feature requests, proposals, ideas, etc. Open discussionneeds:complianceThis means the issue will auto-close after 2 hours.This means the issue will auto-close after 2 hours.opentuiThis relates to changes in v1.0, now that opencode uses opentuiThis relates to changes in v1.0, now that opencode uses opentui
Activity
github-actions commentedon Feb 27, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
For keybind-related issues, please also check our pinned keybinds documentation: #4997
If you believe this was flagged incorrectly, please let a maintainer know.
Eric-GoodBoy-Tech commentedon Feb 27, 2026
Closing as duplicate. Thanks to @github-actions for pointing out the existing issues.
After reviewing:
These cover the core request for subagent session visibility and navigation in TUI. The auto-switch on permission aspect is partially addressed in #15332.
I'll follow those threads instead of duplicating efforts. 👍
IgaoGuru commentedon Mar 4, 2026
@Eric-GoodBoy-Tech hey! Was following the thread of duplicates and found your comment. There should be a working version on #15223 (have been testing personally for the past week). Would be happy to open a PR