Skip to content

fork: bot threads in their own environment - #84

Merged
ribeirogab merged 3 commits into
customfrom
fork/bot-threads
Nov 28, 2026
Merged

ribeirogab merged 3 commits into
customfrom
fork/bot-threads

Conversation

@ribeirogab

Copy link
Copy Markdown
Owner

Bots that use T3 Code over MCP open their threads on the same server as the owner. Every run adds one more row to the sidebar, mixed with the owner's own work, and each bot thread opens with a composer even though the owner only watches it.

Fix

  • A server can declare itself a bots environment with botsEnvironment: true in its own settings.json. This is a per-server fork setting, defaults to false, and is not shared with other servers.
  • Threads of a bots environment no longer appear in the sidebar list, the sidebar search, or the older settled shelf. The command palette still finds them. / never starts a draft in a bots environment project.
  • A robot icon in the sidebar footer opens /bots. It shows a dot when a bot works, waits for the owner, or has an unseen failure.
    • /bots is a sidebar utility page with the upstream Back button, which returns to the page that was open before.
    • The sidebar lists one row per bot. Bot and folder come from the thread title: <folder>/<Bot>: <task>, or <Bot>: <task> without a folder.
    • The page shows Working, Failed, Idle and Runs this week, then one row per bot with its status, task and recent runs.
    • Folder chips (All, one per folder, No folder) filter the sidebar, the rows and the numbers. The choice is kept in localStorage.
  • A bot run opens read-only. A bar in place of the composer shows the bot, its status, Run N of M with arrows to its other runs, and Stop. Stop uses the chat view's interrupt. The composer comes back while the run waits for an approval or an answer.
  • The toggle Bot threads in Settings → Fork → Sidebar is on by default. With it off, or with Fork features off, the app behaves like upstream.
  • Upstream files change by an import and a call or two: the sidebar, the sidebar footer, mainAppLocation, the chat view and the index route. The route tree gains /bots. There is no migration.

Thread shells always carry latestVisibleMessage: null, because message bodies stay in thread detail. Bot rows therefore show the task, the status and the last error, not the agent's live text, and the page opens no detail stream per bot.

Tests

  • botThreads.logic.test.ts: title parsing, grouping and order, folder filter (including a saved folder that no longer exists), overview counts, the footer dot, run position and row details.
  • sidebarFooterItems.logic.test.ts: the bots item with the toggle off, with no bots environment, and shown.
  • BotWatchBar.browser.test.tsx: the bar shows the bot, its status and Run 2 of 3; Stop calls the interrupt; the arrows open the neighbor runs; Stop is hidden when the run cannot be stopped; the composer returns for approvals and questions; threads of other environments keep the composer.
  • Real-app pass with two dev servers, the second one marked as a bots environment and paired into the first, using Replay threads. Checked: the list and search without bot threads, the palette with them, the icon dot, /bots with All and one folder, the bar and its arrows, Stop on a running Replay turn, Back to the previous thread, and the toggle off and on.

Screenshots follow in a comment. Host names and project names in them are masked.

@ribeirogab

Copy link
Copy Markdown
Owner Author

Before (toggle off, upstream behavior): bot threads mixed into the list. After: list without them and the robot icon with its dot; /bots under All and under one folder; a bot run with the read-only bar.

before-list

after-list

bots-all

bots-gabriel

bot-run

@ribeirogab
ribeirogab merged commit 0cff252 into custom Nov 28, 2026
1 check passed
@ribeirogab
ribeirogab deleted the fork/bot-threads branch November 28, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant