-
Notifications
You must be signed in to change notification settings - Fork 4
revert: remove PR #4773 subagent restrictions feature #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This feature is not going to be merged upstream in its current form. Removes: - subagents field from Agent schema and built-in agents - subagents config option - filterSubagents function and runtime validation - Subagent filtering from prompt tool resolution - Subagent filtering from TUI autocomplete - subagents-filter.test.ts test file - Subagents documentation section from agents.mdx The SDK types will be regenerated automatically on the next build.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
WalkthroughThis PR removes the public subagents surface (schemas, tests, docs, runtime filters) and concurrently adds session search, live streaming token estimates, improved Bash/ANSI rendering with ghostty, subagent-sidebar navigation fixes, and several UI/context surface extensions. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/opencode/src/agent/agent.ts (1)
171-228: Intentionally ignoringsubagentsfrom config while keeping it out ofoptionsDestructuring
subagents: _subagentsand then not using it is a reasonable way to tolerate legacysubagentskeys in user config while ensuring they neither affectAgent.Infonor leak intooptions. That’s consistent with dropping subagents from the public agent surface.If
Config’s agent schema has definitively removedsubagentsalready, this alias becomes redundant; you could either drop it or add a brief comment (e.g. “legacy field intentionally ignored”) for future maintainers.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
packages/sdk/js/src/v2/gen/types.gen.tsis excluded by!**/gen/**
📒 Files selected for processing (8)
packages/opencode/src/agent/agent.ts(1 hunks)packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx(0 hunks)packages/opencode/src/config/config.ts(0 hunks)packages/opencode/src/session/prompt.ts(1 hunks)packages/opencode/src/tool/task.ts(0 hunks)packages/opencode/test/subagents-filter.test.ts(0 hunks)packages/sdk/openapi.json(1 hunks)packages/web/src/content/docs/agents.mdx(0 hunks)
💤 Files with no reviewable changes (5)
- packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx
- packages/opencode/test/subagents-filter.test.ts
- packages/opencode/src/config/config.ts
- packages/opencode/src/tool/task.ts
- packages/web/src/content/docs/agents.mdx
🧰 Additional context used
📓 Path-based instructions (3)
packages/opencode/**/*.ts
📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)
packages/opencode/**/*.ts: Use Bun with TypeScript ESM modules as the runtime
Organize file structure using namespace-based organization (e.g.,Tool.define(),Session.create())
Validate all inputs with Zod schemas
UseLog.create({ service: "name" })pattern for logging
UseStoragenamespace for persistence operations
Files:
packages/opencode/src/session/prompt.tspackages/opencode/src/agent/agent.ts
packages/opencode/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)
packages/opencode/**/*.{ts,tsx,js,jsx}: Use relative imports for local modules, with named imports preferred
Use camelCase for variable and function names
Use PascalCase for classes and namespaces
Files:
packages/opencode/src/session/prompt.tspackages/opencode/src/agent/agent.ts
packages/opencode/**/*.{ts,tsx}
📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)
packages/opencode/**/*.{ts,tsx}: Use Zod schemas for validation and TypeScript interfaces for structure
Use Result patterns for error handling; avoid throwing exceptions in tools
Files:
packages/opencode/src/session/prompt.tspackages/opencode/src/agent/agent.ts
🔇 Additional comments (3)
packages/opencode/src/session/prompt.ts (2)
343-354: Remaining subagent_type references are appropriate.The
subagent_typeparameter usage here is part of the task tool's invocation mechanism, which allows one agent to invoke another. This is distinct from the subagent restrictions feature being removed (which would have filtered/validated which subagents could be invoked). The removal correctly eliminates the filtering logic while preserving the underlying invocation capability.
50-50: Remove unusedTASK_DESCRIPTIONfrom the import statement.The import of
TASK_DESCRIPTIONon line 50 is now unused in this file and should be removed along withfilterSubagents. The line should be:import { TaskTool } from "@/tool/task"Verification confirms that
filterSubagentshas been completely removed from the codebase with no dangling references, but the import statement still includesTASK_DESCRIPTIONwhich is not utilized anywhere inprompt.ts.⛔ Skipped due to learnings
Learnt from: CR Repo: Latitudes-Dev/shuvcode PR: 0 File: packages/opencode/AGENTS.md:0-0 Timestamp: 2025-12-02T19:05:23.634Z Learning: Applies to packages/opencode/**/tools/**/*.ts : Implement tools with the `Tool.Info` interface including an `execute()` methodpackages/sdk/openapi.json (1)
8704-8799: Agent required fields now correctly omitsubagentsThe
Agentschema’srequiredarray matches the remaining properties and cleanly dropssubagents, aligning the OpenAPI surface with the reverted subagent restrictions. No structural issues here.
- Add Ctrl+F search with match highlighting and navigation - Add toggle tokens command with IN/OUT display - Add full-screen bash output viewer with ANSI color support - Integrate ghostty-terminal component for terminal rendering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (4)
packages/opencode/src/tool/bash.ts (1)
225-238: Color/TTY env forcing is localized but overrides user preferencesThe added env block correctly scopes color/TTY hints to the bash tool subprocess, which is good for isolating behavior. Note that this force-enables color (and explicitly unsets
NO_COLOR) even if the user has configured the opposite in their environment. If you want to preserve user preferences while still improving defaults, consider only setting these keys when they’re not already defined inprocess.env.packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx (1)
243-261: Subagent navigation now targets correct session; consider UX for missing IDsDeriving
subagentSessionIdfrompart.state.metadataand guardingroute.navigateon its presence fixes the earlier bug where clicks jumped back to the parent session. The status-based metadata selection is reasonable given the different state shapes.When
subagentSessionIdis absent (e.g., very early in task execution or older sessions), the row still appears interactive but clicks no-op. Consider a subtle disabled style or tooltip in that case so users aren’t left wondering why nothing happens.CONTEXT/PLAN-4865-restore-subagent-navigation-2025-12-09.md (1)
78-191: Subagent navigation plan matches code; consider adjusting the “visual feedback” checklistThe root-cause analysis and proposed fix (deriving
subagentSessionIdfrom tool metadata and guarding navigation) match the implemented change insidebar.tsx. One minor nit: Phase 1 marks “Add visual feedback when subagent session ID is not available” as completed, but the current sidebar code only no-ops on click without a visual cue. Either implementing a disabled style/tooltip or unchecking that item would bring the doc fully in line with behavior.packages/opencode/src/cli/cmd/tui/routes/session/index.tsx (1)
184-196: Consider using computed index directly for clarity.While SolidJS signal updates are synchronous, the current pattern reads
currentMatchIndex()after setting it. Using the computed value directly is clearer and avoids potential confusion:function handleNextMatch() { const m = matches() if (m.length === 0) return - setCurrentMatchIndex((prev) => (prev + 1) % m.length) - scrollToMatch(currentMatchIndex()) + const newIndex = (currentMatchIndex() + 1) % m.length + setCurrentMatchIndex(newIndex) + scrollToMatch(newIndex) } function handlePrevMatch() { const m = matches() if (m.length === 0) return - setCurrentMatchIndex((prev) => (prev - 1 + m.length) % m.length) - scrollToMatch(currentMatchIndex()) + const newIndex = (currentMatchIndex() - 1 + m.length) % m.length + setCurrentMatchIndex(newIndex) + scrollToMatch(newIndex) }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (10)
CONTEXT/PLAN-4709-restore-live-token-usage-2025-12-09.md(1 hunks)CONTEXT/PLAN-4791-restore-bash-viewer-ansi-2025-12-09.md(1 hunks)CONTEXT/PLAN-4865-restore-subagent-navigation-2025-12-09.md(1 hunks)CONTEXT/PLAN-4898-restore-search-in-messages-2025-12-09.md(1 hunks)README.md(1 hunks)packages/opencode/package.json(1 hunks)packages/opencode/src/cli/cmd/tui/routes/session/index.tsx(20 hunks)packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx(1 hunks)packages/opencode/src/session/processor.ts(4 hunks)packages/opencode/src/tool/bash.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
packages/opencode/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)
packages/opencode/**/*.{ts,tsx,js,jsx}: Use relative imports for local modules, with named imports preferred
Use camelCase for variable and function names
Use PascalCase for classes and namespaces
Files:
packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsxpackages/opencode/src/tool/bash.tspackages/opencode/src/session/processor.tspackages/opencode/src/cli/cmd/tui/routes/session/index.tsx
packages/opencode/**/*.{ts,tsx}
📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)
packages/opencode/**/*.{ts,tsx}: Use Zod schemas for validation and TypeScript interfaces for structure
Use Result patterns for error handling; avoid throwing exceptions in tools
Files:
packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsxpackages/opencode/src/tool/bash.tspackages/opencode/src/session/processor.tspackages/opencode/src/cli/cmd/tui/routes/session/index.tsx
packages/opencode/**/*.ts
📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)
packages/opencode/**/*.ts: Use Bun with TypeScript ESM modules as the runtime
Organize file structure using namespace-based organization (e.g.,Tool.define(),Session.create())
Validate all inputs with Zod schemas
UseLog.create({ service: "name" })pattern for logging
UseStoragenamespace for persistence operations
Files:
packages/opencode/src/tool/bash.tspackages/opencode/src/session/processor.ts
🧠 Learnings (3)
📚 Learning: 2025-12-02T19:05:12.128Z
Learnt from: CR
Repo: Latitudes-Dev/shuvcode PR: 0
File: packages/desktop/AGENTS.md:0-0
Timestamp: 2025-12-02T19:05:12.128Z
Learning: Applies to packages/desktop/**/*.{ts,tsx} : Use SolidJS with TypeScript as the primary framework
Applied to files:
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
📚 Learning: 2025-12-02T19:05:12.128Z
Learnt from: CR
Repo: Latitudes-Dev/shuvcode PR: 0
File: packages/desktop/AGENTS.md:0-0
Timestamp: 2025-12-02T19:05:12.128Z
Learning: Applies to packages/desktop/**/*.{ts,tsx} : Use function declarations and splitProps for SolidJS component props
Applied to files:
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
📚 Learning: 2025-12-02T19:05:23.634Z
Learnt from: CR
Repo: Latitudes-Dev/shuvcode PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2025-12-02T19:05:23.634Z
Learning: Applies to packages/opencode/**/*.ts : Organize file structure using namespace-based organization (e.g., `Tool.define()`, `Session.create()`)
Applied to files:
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
🧬 Code graph analysis (1)
packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx (1)
packages/opencode/src/session/prompt.ts (1)
metadata(363-372)
🪛 LanguageTool
CONTEXT/PLAN-4709-restore-live-token-usage-2025-12-09.md
[grammar] ~205-~205: Ensure spelling is correct
Context: ...onsider throttling updates (e.g., every 100ms or 100 chars). 3. Context Limit: D...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
CONTEXT/PLAN-4898-restore-search-in-messages-2025-12-09.md
[uncategorized] ~81-~81: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...arkdownSearchHighlighter` component for markdown with code block handling - [x] Add rege...
(MARKDOWN_NNP)
CONTEXT/PLAN-4791-restore-bash-viewer-ansi-2025-12-09.md
[style] ~184-~184: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...s in the TUI may impact performance for very large outputs. The 20-line preview helps miti...
(EN_WEAK_ADJECTIVE)
[grammar] ~188-~188: Use a hyphen to join words.
Context: ...ing. 4. Platform Differences: Color forcing env vars may behave differently ...
(QB_NEW_EN_HYPHEN)
🪛 markdownlint-cli2 (0.18.1)
CONTEXT/PLAN-4709-restore-live-token-usage-2025-12-09.md
4-4: Bare URL used
(MD034, no-bare-urls)
175-175: Bare URL used
(MD034, no-bare-urls)
CONTEXT/PLAN-4898-restore-search-in-messages-2025-12-09.md
4-4: Bare URL used
(MD034, no-bare-urls)
119-119: Bare URL used
(MD034, no-bare-urls)
CONTEXT/PLAN-4791-restore-bash-viewer-ansi-2025-12-09.md
24-24: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🔇 Additional comments (17)
README.md (1)
15-24: README metadata reflects reverted subagent feature correctlyThe removal of the subagent-related PR from the table and the updated
_Last updated_date are consistent with reverting that feature. No further changes needed here.packages/opencode/package.json (1)
48-90: ghostty-opentui dependency addition aligns with new TUI featuresAdding
ghostty-opentui@1.3.6matches the new Ghostty-based bash/ANSI rendering paths. Please just confirm this version is compatible with your current@opentui/*versions and that the workspace lockfile (if any) is updated accordingly.CONTEXT/PLAN-4898-restore-search-in-messages-2025-12-09.md (1)
1-136: Search-in-messages plan is clear and matches the implemented feature setThe phased breakdown (state/types, handlers, highlighters, context wiring, and validation criteria) is coherent and aligns with how the TUI search feature is typically structured. I wouldn’t change anything here; the doc is a solid reference for future maintenance.
CONTEXT/PLAN-4709-restore-live-token-usage-2025-12-09.md (1)
1-208: Live token usage plan aligns with processor/UI changes and flags remaining TODOsThis plan cleanly describes the streaming token pipeline (processor updates, TUI state, toggle command, display format) and correctly leaves
finish-step/contextLimitwork unchecked. It’s a good, accurate design note to keep alongside the code.packages/opencode/src/session/processor.ts (1)
15-15: Token estimation wiring is correct; consider syncing estimates during streaming for live displayThe
reasoningTotal/textTotalaccumulators and use ofToken.toTokenEstimate(...)forreasoningEstimateandoutputEstimateare correctly implemented and scoped to eachprocessrun.The TUI reads these estimates from persisted session state via
props.message. Currently, these in-memory updates (lines 93, 322) are not persisted untilfinish-stepcompletes (line 276), so clients will only see final token estimates after streaming ends, not during streaming. To enable true "live" token display while streaming, consider callingSession.updateMessage(input.assistantMessage)(ideally throttled) inside thereasoning-deltaandtext-deltabranches to sync estimates to session state as they accumulate.CONTEXT/PLAN-4791-restore-bash-viewer-ansi-2025-12-09.md (1)
1-188: Well-structured implementation plan.The document provides clear phase breakdowns, status tracking, validation criteria, and risk considerations. The approach for forcing color output via environment variables is well-documented.
Minor linter suggestions (hyphenation of "color-forcing", "very large" style) are non-blocking for internal documentation.
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx (11)
68-70: LGTM! Ghostty terminal component properly registered.The
GhosttyTerminalRenderableimport and registration viaextendfollows the correct pattern for adding custom components to opentui.
106-116: Clean type definitions.The
SearchMatchtype captures all necessary information for navigating search results.BashOutputViewcorrectly uses an accessor function() => stringfor lazy output evaluation.
274-285: LGTM! Keyboard handling follows expected patterns.ESC to close the bash viewer and Ctrl+F for search are standard shortcuts. The early return when
bashOutput()is active correctly prevents event propagation.
334-343: Search command registration follows existing patterns.The "Search messages" command is properly registered with the command dialog, including keybind and category.
580-592: Token visibility toggle properly persisted.The toggle follows the same pattern as other session toggles, persisting state to kv store.
1098-1129: LGTM! Search input properly integrated.The search input receives all necessary callbacks and state is properly cleaned up on exit. The
matchInfoprop provides current/total counts for the UI.
1273-1329: Token display implementation is well-designed.The token calculations properly combine actual values with estimates using fallback patterns. The
~prefix clearly indicates these are estimates, andtoLocaleString()improves readability for large numbers.
1565-1601: LGTM! Bash tool properly integrates ghostty terminal rendering.The output memo correctly preserves ANSI codes for rendering. The
limit={20}prop handles truncation, and the "Click to see full output" interaction correctly passes the output accessor toshowBashOutput.
1919-1922: LGTM! Standard regex escape implementation.The function correctly escapes all regex metacharacters, preventing injection when building patterns from user search queries.
958-964: Context provider properly extended with new features.All new fields (
showTokens,searchQuery,currentMatchIndex,matches,showBashOutput) are correctly wired to the context provider, matching the type definition.
1089-1095: Remove or verify PageUp/PageDown scrolling functionality in bash viewer.The help text at line 1094 states "PageUp/PageDown to scroll", but the keyboard handler (lines 274-280) only processes the ESC key when
bashOutput()is active and returns immediately for all other keys. No keybind configuration for PageUp/PageDown is present in the codebase. Either confirm thatghostty-opentuihandles scrolling natively and update the help text to clarify this, or implement explicit keyboard handlers for PageUp/PageDown scrolling.
|
@kcrommett I've opened a new pull request, #106, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * fix: replace strikethrough with ANSI highlighting for search results Co-authored-by: kcrommett <523952+kcrommett@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kcrommett <523952+kcrommett@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx (2)
91-203: Search context surface and navigation logic are well-structured; consider tightening match scrollingThe additional context fields (
showTokens,searchQuery,currentMatchIndex,matches,showBashOutput) and theSearchMatch/BashOutputViewtypes are cohesive and make downstream usage clear. Thematchesmemo correctly short-circuits whensearchQueryis empty and performs a simple, case-insensitive scan over text parts.One small clarity improvement: in
handleNextMatch/handlePrevMatch, you can compute the next index once and pass it directly toscrollToMatchinstead of readingcurrentMatchIndex()after the setter, which avoids any dependence on signal timing semantics and makes the intent explicit:- function handleNextMatch() { - const m = matches() - if (m.length === 0) return - setCurrentMatchIndex((prev) => (prev + 1) % m.length) - scrollToMatch(currentMatchIndex()) - } + function handleNextMatch() { + const m = matches() + if (m.length === 0) return + setCurrentMatchIndex((prev) => { + const next = (prev + 1) % m.length + scrollToMatch(next) + return next + }) + }(and similarly for
handlePrevMatch).
1376-1388: Search highlighting via ANSI is safe; consider optional multi-part awarenessReplacing the previous markdown-strikethrough approach with ANSI-based highlighting in
TextPartis a nice improvement for actual visibility. Escaping the query viaescapeRegexbefore building theRegExpprevents regex injection, and limiting the substitution toprops.part.text.trim()keeps behavior identical when no query is active.Two minor, optional enhancements you might consider later:
- If you want search to feel fully consistent across roles, mirror this highlighting for user text as well, not just assistant
TextParts.- If the markdown renderer ever treats ANSI sequences oddly inside
filetype="markdown"code blocks, you could add an explicitansi-aware path (similar to theghostty-terminalusage) or strip ANSI for non-TTY exports, but that’s more of a UX polish than a correctness issue.Overall, the current implementation is sound.
Also applies to: 1398-1398, 1921-1923
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx(20 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
packages/opencode/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)
packages/opencode/**/*.{ts,tsx,js,jsx}: Use relative imports for local modules, with named imports preferred
Use camelCase for variable and function names
Use PascalCase for classes and namespaces
Files:
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
packages/opencode/**/*.{ts,tsx}
📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)
packages/opencode/**/*.{ts,tsx}: Use Zod schemas for validation and TypeScript interfaces for structure
Use Result patterns for error handling; avoid throwing exceptions in tools
Files:
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
🧠 Learnings (3)
📚 Learning: 2025-12-02T19:05:12.128Z
Learnt from: CR
Repo: Latitudes-Dev/shuvcode PR: 0
File: packages/desktop/AGENTS.md:0-0
Timestamp: 2025-12-02T19:05:12.128Z
Learning: Applies to packages/desktop/**/*.{ts,tsx} : Use SolidJS with TypeScript as the primary framework
Applied to files:
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
📚 Learning: 2025-12-02T19:05:12.128Z
Learnt from: CR
Repo: Latitudes-Dev/shuvcode PR: 0
File: packages/desktop/AGENTS.md:0-0
Timestamp: 2025-12-02T19:05:12.128Z
Learning: Applies to packages/desktop/**/*.{ts,tsx} : Use function declarations and splitProps for SolidJS component props
Applied to files:
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
📚 Learning: 2025-12-02T19:05:23.634Z
Learnt from: CR
Repo: Latitudes-Dev/shuvcode PR: 0
File: packages/opencode/AGENTS.md:0-0
Timestamp: 2025-12-02T19:05:23.634Z
Learning: Applies to packages/opencode/**/*.ts : Organize file structure using namespace-based organization (e.g., `Tool.define()`, `Session.create()`)
Applied to files:
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
🧬 Code graph analysis (1)
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx (1)
packages/opencode/src/cli/cmd/tui/component/prompt/search.tsx (1)
SearchInput(35-230)
🔇 Additional comments (5)
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx (5)
28-71: SearchInput and Ghostty terminal integration look consistentThe wiring for
SearchInputandGhosttyTerminalRenderableviaextend({ "ghostty-terminal": GhosttyTerminalRenderable })is straightforward and matches existing patterns for OpenTUI extensions; no issues from a composition/registration standpoint.
271-285: Keyboard handling for bash output and search mode is sensibleShort-circuiting all global key handling while
bashOutput()is active (except ESC to close) is a good safety measure and prevents accidental session actions while in the fullscreen terminal view. Addingctrl+fhere to entersearchModelines up with the SearchInput keybinding behavior and doesn’t appear to conflict with existing permission-handling logic.
333-343: Command palette entries for search and token toggling are well-integratedThe new
"Search messages"command cleanly flipssearchModeand clears the dialog, relying onSearchInput’s own mount-time focus, which is simple and predictable. The"Show/Hide tokens"entry correctly persists state viakv.set("show_tokens", next)and reuses the existingshowTokenssignal exposed in context; naming and behavior are consistent with the other toggles.Also applies to: 580-592
1234-1236: Token display wiring is correct and non-intrusiveUsing
ctx.showTokens()to gate both the usersentEstimatedisplay and the assistant IN/OUT/reasoning token summary is a clean way to add live metrics without cluttering the default UI. The token computations (sentEstimate + contextEstimate,tokens.output ?? outputEstimate,tokens.reasoning ?? reasoningEstimate) are straightforward and fall back gracefully when estimates or finalized counts are missing.Also applies to: 1257-1281, 1324-1329
1570-1597: Bash tool ghostty rendering and truncation UX are well thought outThe Bash tool’s render function now:
- Derives
outputfromprops.metadata.output?.trim() ?? "",- Uses
<ghostty-terminal ansi={output()} limit={20} />for a compact inline view, and- Detects truncation via
lines().length > 20, offering a clickable “see full output” that callsshowBashOutput.This fits nicely with the fullscreen
bashOutputview and keeps long command output from overwhelming the conversation while still being easily accessible. No issues spotted with the logic or context usage.
Summary
Changes
Removes:
subagentsfield from Agent schema and built-in agentssubagentsconfig option for filtering agent invocationsfilterSubagentsfunction and runtime validation in Task toolsubagents-filter.test.tstest fileThe SDK types will be regenerated automatically on the next build.
Context
This was originally from upstream PR anomalyco#4773 which added the ability to hide subagents from primary agents. The feature is not going to be merged upstream in its current form, so we're removing it from our fork.
Summary by CodeRabbit
Refactor
New Features
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.