Skip to content

feat: T3_BOT bot identities, floating bot window, collapsible sections and @bot tags - #5

Open
na0s-fleet-agents[bot] wants to merge 20 commits into
mainfrom
feat/t3-bot
Open

na0s-fleet-agents[bot] wants to merge 20 commits into
mainfrom
feat/t3-bot

Conversation

@na0s-fleet-agents

@na0s-fleet-agents na0s-fleet-agents Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Standalone branch. Based on main and includes the window-hub commits from #4, which the bot window uses to share the main window's connection, so it can be kept or rebased without #4. If #4 lands first, this diff shrinks to the T3_BOT features.

Problem

I want persistent assistant bots that sit on top of T3 Code as their thread manager. Each bot has its own identity, conversations, routines and webhooks, and lives in a narrow floating window beside my other windows. Right now a "bot" is just another project, so its threads crowd the main sidebar. There is also no compact window for talking to it, and no way to fold a long status exchange into one row. Design and wireframes: Na0s/t3-bots (docs/design.md, layout A3).

What this adds

  • Bot identities, no migration. Server settings gain bots: Record<ProjectId, {role, mainThreadId, order}>. A listed project is a bot; its title and icon are the bot's name and icon. Clients get isBot on the project the same way they get isScratch. Settings already reach every client, and a settings key avoids a fork-only database migration that could collide with upstream numbering.
  • Hidden from the main UI. Bot projects and their threads leave the sidebar, the command palette, project pickers, new-thread defaults, thread search and the mobile lists. There is one filter in client-runtime (visibleProjectsAtom and the unlisted thread keys). Notifications for bot threads still fire. To make a project a bot or undo it, use the T3_BOT section in its project settings (toggle and role).
  • /bot route (layout A3).
    • The header has the hamburger and search at the top left, the active bot card in the centre and + at the top right.
    • Bots with unread threads stack behind the card (two visible, fading). A bot that needs input slides out with a label in its own colour.
    • Clicking the card turns the top bar into a horizontal switcher with icons, status and a New bot entry.
    • The hamburger swaps the chat for a T3-style thread list: the active bot's threads with forks nested, other bots as collapsed groups, and Routines and Settings in the footer.
    • Chat is the existing ChatView in embedded mode. At 720 px and wider the thread list stays open as a sidebar. New bot creates a managed project and registers it.
  • Desktop window. windows.bot.open(), the Window menu item "Open T3_BOT" and the bot.open keybinding (mod+alt+shift+b) open a single bot window at #/bot through the hub. Its size presets are narrow (380×720) and medium (900×760). Pin makes it always on top, using the floating level on macOS. Bounds, size and pin persist. Pin and Expand appear in the bot window only.
  • Collapsible sections. A bot reply carrying <!-- t3bot:section kind="status-check" --> opens a section that runs to the next marker, <!-- t3bot:section-end -->, or the end of the thread. Closed sections fold into one row, "Status Check - HH:MM:SS >", using the existing turn-fold row on web and mobile. The markers never render.
  • Tag a bot from any thread. Typing @ in any composer, on web or mobile, lists the environment's bots with icon and role. On send, the server delivers the message once to the bot's main conversation. That is its `mainThreadId` if set, else its most recent thread, else a new "Main" thread. The delivered text reads Tagged from <title> (<t3-thread link>):. Delivery runs as an outbox effect in its own lane, with fixed command and message ids, so a replay or retry never delivers twice. The tagging thread's agent sees @Atlas (T3_BOT, notified), and the sent chip shows a check.
  • Dev Replay scenario bot-sections, for trying sections without a paid model.

Screenshots (dev server, real client)

Narrow: section folded Narrow: section expanded Warden needs input
Thread list Medium width

Tagging Atlas from a regular thread (the bot's Main thread received one Tagged from message with a backlink):

Verification

  • vp run check:changed: format, lint, knip, graphql, typecheck (41 packages), tests (83 files) and react compiler all pass.
  • New tests:
    • bots settings patch;
    • project isBot and the visible list;
    • the bot thread filter and the bot-only quiet list;
    • section parsing (23 cases) and timeline folding;
    • mobile section folding;
    • BotShell logic (stack, needs-input, thread tree);
    • DesktopWindow (single bot window, #/bot, size clamp, pin, persistence);
    • DesktopAppSettings round trip;
    • keybindings;
    • bot mention delivery against the real orchestrator (one effect per bot, exactly-once on replay, archived main falls back, a new "Main" on retry is not duplicated, non-bot and cross-environment skipped).
  • Real web client against the worktree dev server:
    • created Atlas and Warden from the UI;
    • replayed a sectioned conversation, which folded and expanded;
    • a Warden question showed as a "Needs input" slide-out;
    • the thread list and medium layout worked;
    • the main sidebar showed no bot projects or threads;
    • @Atl in a regular thread listed Atlas, and sending delivered exactly one Tagged from message to Atlas's Main thread (checked with t3 thread show).

Not verified

  • The Electron bot window was not launched (developed in WSL). Floating level, title bar and multi-display resize are untested.
  • Mobile was not run on a device.

Not in this PR

  • A custom iPhone push from a bot. For now bots use T3's phase pushes (a reply or waiting for input notifies). A custom relay alert needs upstream relay support.
  • Spin-off from the bot window (embedded ChatView has no fork action).

Done with Claude Opus 5.5 in Claude Code, driving parallel subagents in T3 Code.

🤖 Generated with Claude Code

@na0s-fleet-agents na0s-fleet-agents Bot changed the title feat: T3_BOT bot identities, floating bot window and collapsible sections feat: T3_BOT bot identities, floating bot window, collapsible sections and @bot tags Nov 21, 2026
@na0s-fleet-agents
na0s-fleet-agents Bot changed the base branch from feat/desktop-multi-window-hub to main November 21, 2026 22:29
Na0s and others added 20 commits November 23, 2026 10:06
Secondary windows are thin clients: the main window's renderer is a hub that
relays each environment's RPC over a MessagePort and shares its subscription
streams, so a new window opens without its own sockets or auth. The desktop
shell opens them from New Window (command palette, Window menu, and
mod+alt+shift+n), trusts IPC from every app window, scopes preview tabs to
the window that shows them, and keeps the main window hidden rather than
closed while it serves other windows. Windows merge their shared UI state and
composer drafts instead of overwriting each other's saves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reuses its supervisor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ir window

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mponent state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bot is a project listed in server settings `bots` (role, main thread,
order). The project keeps the name and icon; clients get `isBot` on the
project like `isScratch`. No migration: settings already stream to every
client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n lists

Bot projects belong to the bot window, but every project and thread list in
the main window still showed them.

Client-runtime now derives `visibleProjectsAtom` (projects without `isBot`)
and leaves bot-project threads out of the visible, quiet and navigation thread
lists. Bot threads stay out of `hiddenThreadKeysAtom`, so notifications for
them still show, and point reads and `threadShellsAtom` stay complete. The
web sidebar, command palette, project pickers, new-thread defaults and
prompt links, and the mobile home, sidebar, palette and new-task flow read the
visible projects. Scheduled-task thread pickers keep bot threads, since a
bot's tasks post to its own conversations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Project settings gain a T3_BOT section: a switch that adds or removes the
project in server settings `bots`, and a Role field. Edits keep the bot's
main thread and order, since `bots` patch entries replace. Settings project
menus mark bot projects with "T3_BOT" so they stay findable and manageable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An assistant message carrying `<!-- t3bot:section kind="..." -->` now opens a
section that starts at its turn's prompt and runs to the next section marker,
a `<!-- t3bot:section-end -->` marker (inclusive), or the end of the thread.
The whole span folds under one "Status Check - HH:MM:SS" row that reuses the
turn fold row and expanded-run state. Closed sections start collapsed; the
latest open section, or one ended inside a still-running turn, starts expanded.

The marker parser and span derivation live in @t3tools/shared/botSections.
Web folds sections in deriveMessagesTimelineRows, keeps nested work folds,
rebuilds the streaming fast path when a marker appears, shows all sections
while thread find is open, and opens a cited message's section. Mobile folds
the presented feed and opens the section of a message it jumps to. Both
renderers already drop HTML comments, so markers stay invisible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`windows.bot` opens a single bot window at `#/bot` (Electron renderers use
hash history, so dev and packaged URLs both work) or brings it forward. It
is a secondary window, so it connects through the main window's hub and the
main window hides rather than closes while it is open.

The window starts narrow (380x720) and `setSize` switches to medium
(900x760), pulled back onto the display's work area. `setPinned` keeps it
above other windows, at the floating level on macOS like the preview
picture-in-picture window. Bounds, size and pin persist in desktop settings
under `botWindow`; the bot window's context carries its size and pin state.

The Window menu gains "Open T3_BOT", the `bot.open` keybinding defaults to
mod+alt+shift+b on desktop, and the command palette lists it next to New
Window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Implements the A3 bot stack outside the _chat layout: a header with the
active bot card, unread bots stacked behind it, a slide-out card for a bot
that needs the user, and a switcher that takes over the top bar. The
hamburger shows a sidebar-style thread list (forks nested under their
parent, other bots folded with status, archived count, routines, settings,
pin and expand); at 720px and up it stays open beside the chat. The chat is
an embedded ChatView, and + opens a draft through the existing new-thread
flow without leaving the route. New bot creates a managed project and lists
it in settings.bots.

Shared changes: createNewThreadHandler takes navigate: false, ChatView
accepts embedded for drafts, and the root leaves out the main sidebar on
/bot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pin state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A user message can tag a bot with a `bot` composer context record. When it
commits, the orchestrator enqueues one `bot-mention.deliver` effect per
message and bot. The effect runs in its own lane beside the source thread's
provider start and queues "Tagged from <thread> (<link>):" plus the message
into the bot's main thread, else its most recent thread, else a new "Main"
thread on the bot's default model. Deterministic command ids make replays
and restarts deliver once. The tagging thread's agent reads the tag as
"@name (T3_BOT, notified)".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The @ menu lists the composer environment's bots by name and role, next
to threads and machines. Picking one inserts a bot chip backed by a `bot`
context record, which drafts, stashes, history recall, queued edits and
paste keep like machine mentions. In a sent message the chip shows that
the bot was notified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bot's copy is relayed for the user, like other server-sent messages,
so it carries T3 Code's attribution and stays out of prompt history
recall. The composer guide covers tagging a bot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bot window, its settings, the @ bot chip and the Open T3_BOT command
now wrap their copy for GT. This adds the new keys to the web, mobile and
desktop catalogs in English and the nine shipped languages, at the
positions `gt generate` gives them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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