Skip to content

✨ feat(tasks): unified Tasks routes, detail polish & CC Agent streaming#14109

Merged
arvinxx merged 19 commits into
canaryfrom
feat/tasks-polish
Apr 24, 2026
Merged

✨ feat(tasks): unified Tasks routes, detail polish & CC Agent streaming#14109
arvinxx merged 19 commits into
canaryfrom
feat/tasks-polish

Conversation

@arvinxx

@arvinxx arvinxx commented Apr 24, 2026

Copy link
Copy Markdown
Member

πŸ’» Change Type

  • ✨ feat
  • πŸ’„ style
  • ♻️ refactor

πŸ”— Related Issue

N/A

πŸ”€ Description of Change

Two themes in this branch.

A. Unified Tasks page (cross-agent)

Replace the agent-scoped /agent/:aid/tasks pages with a single cross-agent surface at /tasks (list) + /task/:taskId (detail), and polish the detail UI.

  • Routes & sidebar: new /tasks (list) and /task/:taskId (detail) registered in both desktopRouter.config*; legacy agent/tasks removed; sidebar gets a top-level Tasks entry.
  • List polish: identifier shows as secondary text ahead of the name; date formatting moved into a shared formatTaskItemDate helper driven by discover:time.format* keys; completed & canceled tasks hidden by default behind a footer Show n toggle; Linear-style right-click context menu (useTaskItemContextMenu) with copy id / copy link / open in board view.
  • Detail page:
    • Header actions: Copy id / Copy link, using APP_URL origin so links resolve outside the local instance
    • Cross-agent breadcrumb β€” drop the agent avatar branch and the agentId plumbing through TaskDetailPage / route params, since the unified route doesn't need it
    • Subtasks: add button moved inline next to the accordion header; inline create entry rendered inside the accordion body
    • Run / rerun button: local isStarting state shows a loading button between click and status flip (covers the lag before the server flips status)
    • Topic chat drawer: floating card variant (rounded, shadow, no mask), messages rendered read-only (MessageItem disableEditing, ChatList disableActionsBar)

B. Claude Code Agent tool β€” streaming render

While a CC subagent is running, the Agent tool used to fall back to the generic ε‚ζ•°εˆ—θ‘¨ arg dump. Register a dedicated streaming component that shows the instruction markdown plus β€” once the executor has created the subagent Thread β€” an open/close subtopic toggle so the user can jump into the live conversation instead of waiting for the summary.

Wiring:

  • packages/builtin-tool-claude-code/src/client/Streaming/Agent/index.tsx β€” the renderer
  • packages/builtin-tool-claude-code/src/client/Streaming/index.ts β€” exposes ClaudeCodeStreamings
  • packages/builtin-tools/src/streamings.ts β€” registers it under ClaudeCodeIdentifier

πŸ§ͺ How to Test

  • Tested locally
  • Added/updated tests
  • No tests needed

Unit tests:

  • formatTaskItemDate.test.ts β€” date format branching (today / this year / other year)
  • taskCardListDisplay.test.ts β€” completed filter + sort + limit

Manual (desktop SPA):

  • Sidebar β†’ Tasks β†’ list view: identifier shown in secondary style; completed tasks hidden until Show n is clicked; right-click an item to see Copy id / Copy link / Open kanban
  • Open a task β†’ detail page: copy id / link in header buttons produces an app-origin URL; breadcrumb shows All Tasks β†’ … β†’ current
  • Subtasks: click the inline + β†’ create entry appears inside the accordion body
  • Click Run on a backlog task β†’ button shows loading state until status transitions
  • Click a topic in the activity feed β†’ floating chat drawer opens; messages render read-only (no inline edit toolbar)
  • CC Agent tool (e.g. Explore) while subagent runs:
    • Body shows the instruction block (not the generic arg table)
    • Once the subagent Thread is created, the View full subagent conversation toggle appears and opens the portal

πŸ“ Additional Information

Known gap (out of scope, separate follow-up PR): tasks can remain stuck in running status after the agent completes. Two issues found while testing this branch:

  1. TaskLifecycleService.onTopicComplete only branches on reason === 'done' | 'error' β€” max_steps / cost_limit / waiting_for_human / interrupted fall through with no status update.
  2. The hook config in src/server/routers/lambda/task.ts declares webhook URL /api/workflows/task/on-topic-complete, but no route handler exists under src/app/(backend)/api/workflows/task/. In queue mode (isQueueAgentRuntimeEnabled) the local handler is skipped and the webhook 404 is silently swallowed, so the task lifecycle never finalizes.

Will be fixed in a follow-up PR.

πŸ€– Generated with Claude Code

arvinxx and others added 3 commits April 24, 2026 10:47
Completed tasks crowd the homepage card list and bury the ones that
still need attention; extract sort/limit into a testable helper so the
filter lives in one place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… subagent thread toggle

While a subagent is running (args parsed, tool_result not back) the CC
Agent tool fell back to the generic ε‚ζ•°εˆ—θ‘¨ dump. Surface the instruction
markdown and, once the executor has created the subagent Thread, the
open/close subtopic button β€” so the user can jump into the live
conversation instead of waiting for the summary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Apr 24, 2026 1:20pm

Request Review

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 24, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @arvinxx, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@dosubot dosubot Bot added feature:agent Assistant/Agent configuration and behavior feature:streaming Streaming response issues feature:tool Tool calling and function execution labels Apr 24, 2026
@codecov

codecov Bot commented Apr 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.37500% with 15 lines in your changes missing coverage. Please review.
βœ… Project coverage is 67.34%. Comparing base (f7ed6df) to head (7d04800).
⚠️ Report is 12 commits behind head on canary.

Additional details and impacted files
@@           Coverage Diff            @@
##           canary   #14109    +/-   ##
========================================
  Coverage   67.33%   67.34%            
========================================
  Files        2155     2157     +2     
  Lines      184805   184890    +85     
  Branches    18303    19094   +791     
========================================
+ Hits       124433   124506    +73     
- Misses      60247    60259    +12     
  Partials      125      125            
Flag Coverage Ξ”
app 60.15% <84.37%> (+0.01%) ⬆️
database 92.23% <ΓΈ> (ΓΈ)
packages/agent-runtime 79.82% <ΓΈ> (ΓΈ)
packages/context-engine 83.10% <ΓΈ> (ΓΈ)
packages/conversation-flow 92.40% <ΓΈ> (ΓΈ)
packages/file-loaders 87.02% <ΓΈ> (ΓΈ)
packages/memory-user-memory 74.74% <ΓΈ> (ΓΈ)
packages/model-bank 99.89% <ΓΈ> (ΓΈ)
packages/model-runtime 84.07% <ΓΈ> (ΓΈ)
packages/prompts 70.14% <ΓΈ> (ΓΈ)
packages/python-interpreter 92.90% <ΓΈ> (ΓΈ)
packages/ssrf-safe-fetch 0.00% <ΓΈ> (ΓΈ)
packages/utils 88.41% <ΓΈ> (ΓΈ)
packages/web-crawler 88.66% <ΓΈ> (ΓΈ)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Ξ”
Store 67.16% <48.00%> (-0.01%) ⬇️
Services 51.79% <ΓΈ> (ΓΈ)
Server 66.60% <100.00%> (-0.01%) ⬇️
Libs 52.50% <ΓΈ> (ΓΈ)
Utils 80.09% <ΓΈ> (ΓΈ)
πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b68cadbd3e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +10 to +11
export const getVisibleTaskCardTasks = (tasks: TaskListItem[]) =>
tasks.filter((task) => task.status !== 'completed');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Filter non-completed tasks in the fetch, not after truncation

getVisibleTaskCardTasks filters out completed items only after the list has already been fetched and paginated, which can hide active work. useFetchTaskList requests taskService.list({ assigneeAgentId }) without statuses/limit, and the backend defaults to limit=50 sorted by createdAt (src/server/routers/lambda/task.ts list schema), so if the newest 50 are completed while older backlog/running tasks still exist, this card becomes empty and disappears even though unresolved tasks remain. The status filter should be applied in the query (or fetch enough rows) so unfinished tasks are not dropped by pagination.

Useful? React with πŸ‘Β / πŸ‘Ž.

… menu

- Wire up /tasks as a top-level home sidebar item (gated on enableAgentTask) and register route metadata for Electron tab title
- Render a dashed UserRound placeholder when a task has no assignee, and add a search input + arrow-key navigation to the agent picker popover
- Wrap task list rows in a ContextMenuTrigger with status/priority submenus, copy id/link, and delete-with-confirm

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Apr 24, 2026
arvinxx and others added 6 commits April 24, 2026 17:46
…nt-scoped pages

Removes the per-agent `/agent/:aid/tasks` list and detail routes in favor of a
single cross-agent surface (`/tasks` list/kanban + `/task/:taskId` detail).
Kanban board now fetches across all agents via `useFetchTaskGroupList({ allAgents })`,
fixing the blank board on the `/tasks` route.

UI polish shipped alongside:
- Hidden kanban columns panel persists to global status, pinned to the right with
  a swim-lane background to match other columns.
- Breadcrumb chevron margins tightened; separator, ancestors, and task detail
  crumbs share the same compact styling.
- TaskDetailAssignee renders a clickable "Unassigned" placeholder when no agent
  is set, so the selector is always reachable.
- Run button stays clickable without an assignee; falls back to the inbox agent
  on click so users get a working default.
- Breadcrumb drops the per-agent tasks link; nav inside agents removes the now
  dangling Tasks tab since `/tasks` is a top-level sidebar entry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ooter

Hides completed/canceled tasks by default in the list view with a Linear-style "N tasks hidden by display options Β· Show" footer and a toggle in the display-options popover.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…p origin

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Apr 24, 2026
@arvinxx arvinxx changed the title ✨ feat: task card list polish and Claude Code Agent streaming render ✨ feat(tasks): unified Tasks routes, detail polish & CC Agent streaming Apr 24, 2026
arvinxx and others added 4 commits April 24, 2026 19:14
… webhook

Consolidate workflow routes behind a single Hono app mounted at the
catch-all /api/workflows/[[...route]], with per-domain sub-apps. New
workflow segments now only need a folder under src/server/workflows-hono/
plus one app.route(...) line in the root β€” no new Next.js route files.

Also implements /api/workflows/task/on-topic-complete, which task.run
registers as the onComplete webhook. The handler wires the payload into
TaskLifecycleService.onTopicComplete; task.run now also includes
taskIdentifier in the webhook body so the handler skips a DB lookup.

LOBE-6659

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Mount AgentTaskManager conversation alongside the task detail route and
  sync the task's assignee agent into chat store so the right panel talks
  to the correct agent
- Reverse activities timeline to newest-first and float the comment input
  on top with a card-styled container and guiding placeholder copy
- Redesign TopicCard with a live status icon, meta row, and dropdown
  actions (open run / copy id); introduce shared TopicStatusIcon with
  animated running state
- Swap task status palette: running uses warning+CircleDot, paused uses
  info+Hand; show numeric shortcut extras on context menu status/priority
  items alongside the checkmark for the current value
- Refresh hidden-columns panel to panel-open/close icons and inline the
  count beside the header
- Drop fixed min height on create-task inline editor; tighten activity
  row padding
- Fix Flexbox import in useTaskItemContextMenu (react-layout-kit β†’ @lobehub/ui)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
arvinxx and others added 5 commits April 24, 2026 20:45
Task list does not save anything, but it reused the global taskSaveStatus from detail page β€” after editing a task, switching back to the list would still show "latest version loaded".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Status is already expressed by the colored TopicStatusIcon next to the title.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@arvinxx arvinxx merged commit b3dc59f into canary Apr 24, 2026
34 checks passed
@arvinxx arvinxx deleted the feat/tasks-polish branch April 24, 2026 13:32
arvinxx added a commit that referenced this pull request Apr 25, 2026
)

* πŸ”₯ feat(tasks): drop per-agent /agent/:aid/tasks routes again

PR #13887 reintroduced the per-agent Tasks surface (sidebar entry, route
files, agentId-scoped breadcrumb/list/board, /agent/:aid/tasks/:taskId
navigation) that #14109 had removed in favor of unified /tasks and
/task/:id. Restore the unified-only model: drop the agent sidebar Tasks
nav item, delete the agent-scoped route files, strip agent-tasks blocks
from both desktopRouter configs, and revert the agentId props and
per-agent navigate paths in AgentTasksPage / KanbanBoard / Breadcrumb /
TaskDetailPage. Preserves #14137's canceled kanban column.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ› fix(agent): redirect any agent sub-route before opening new topic

handleNewTopic only checked /profile and /channel, so on /agent/:aid/page,
/agent/:aid/cron/:cronId or other sub-routes the redirect was skipped and
mutate() opened a new topic on a non-chat screen β€” looking ineffective to
the user. Match useTopicNavigation's pattern: derive an agent base path
from params (with topicId when present) and treat anything longer than
that as a sub-route, so adding new sub-routes never re-introduces this gap.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ› fix(agent): always push agent chat route before opening new topic

The previous fix conditioned the redirect on isInAgentSubRoute, which
left the URL untouched on /agent/:aid/:topicId β€” opening a new topic
while the URL still pointed at the previous one. Drop the conditional
and always push /agent/:aid: it covers every sub-route (/profile,
/channel, /page, /cron/:cronId, …) and strips any stale :topicId so
the URL matches the freshly opened topic. Restores Nav.test.tsx.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Innei pushed a commit that referenced this pull request Apr 25, 2026
…ng (#14109)

* ✨ feat: polish task list id and date display

* ✨ feat: hide completed tasks from agent task card list

Completed tasks crowd the homepage card list and bury the ones that
still need attention; extract sort/limit into a testable helper so the
filter lives in one place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ✨ feat(claude-code): render Agent tool streaming with instruction and subagent thread toggle

While a subagent is running (args parsed, tool_result not back) the CC
Agent tool fell back to the generic ε‚ζ•°εˆ—θ‘¨ dump. Surface the instruction
markdown and, once the executor has created the subagent Thread, the
open/close subtopic button β€” so the user can jump into the live
conversation instead of waiting for the summary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ✨ feat(tasks): add /tasks sidebar entry and Linear-style item context menu

- Wire up /tasks as a top-level home sidebar item (gated on enableAgentTask) and register route metadata for Electron tab title
- Render a dashed UserRound placeholder when a task has no assignee, and add a search input + arrow-key navigation to the agent picker popover
- Wrap task list rows in a ContextMenuTrigger with status/priority submenus, copy id/link, and delete-with-confirm

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ✨ feat(tasks): unify task routes under /tasks and /task/:id, drop agent-scoped pages

Removes the per-agent `/agent/:aid/tasks` list and detail routes in favor of a
single cross-agent surface (`/tasks` list/kanban + `/task/:taskId` detail).
Kanban board now fetches across all agents via `useFetchTaskGroupList({ allAgents })`,
fixing the blank board on the `/tasks` route.

UI polish shipped alongside:
- Hidden kanban columns panel persists to global status, pinned to the right with
  a swim-lane background to match other columns.
- Breadcrumb chevron margins tightened; separator, ancestors, and task detail
  crumbs share the same compact styling.
- TaskDetailAssignee renders a clickable "Unassigned" placeholder when no agent
  is set, so the selector is always reachable.
- Run button stays clickable without an assignee; falls back to the inbox agent
  on click so users get a working default.
- Breadcrumb drops the per-agent tasks link; nav inside agents removes the now
  dangling Tasks tab since `/tasks` is a top-level sidebar entry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ✨ feat(tasks): hide completed & canceled tasks by default with Show footer

Hides completed/canceled tasks by default in the list view with a Linear-style "N tasks hidden by display options Β· Show" footer and a toggle in the display-options popover.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ✨ feat(tasks): add copy id/link actions to task detail header, use app origin

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ”₯ refactor(tasks): drop agentId plumbing from unified task detail route

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ’„ style(tasks): float topic chat drawer with read-only messages

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ’„ style(tasks): inline subtasks add button and run button loading state

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ✨ feat(workflows): unify hono scaffold and add task on-topic-complete webhook

Consolidate workflow routes behind a single Hono app mounted at the
catch-all /api/workflows/[[...route]], with per-domain sub-apps. New
workflow segments now only need a folder under src/server/workflows-hono/
plus one app.route(...) line in the root β€” no new Next.js route files.

Also implements /api/workflows/task/on-topic-complete, which task.run
registers as the onComplete webhook. The handler wires the payload into
TaskLifecycleService.onTopicComplete; task.run now also includes
taskIdentifier in the webhook body so the handler skips a DB lookup.

LOBE-6659

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ’„ style(tasks): align subtasks header pill with add button on same row

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* ✨ feat(tasks): add AgentTaskManager side panel and polish task detail

- Mount AgentTaskManager conversation alongside the task detail route and
  sync the task's assignee agent into chat store so the right panel talks
  to the correct agent
- Reverse activities timeline to newest-first and float the comment input
  on top with a card-styled container and guiding placeholder copy
- Redesign TopicCard with a live status icon, meta row, and dropdown
  actions (open run / copy id); introduce shared TopicStatusIcon with
  animated running state
- Swap task status palette: running uses warning+CircleDot, paused uses
  info+Hand; show numeric shortcut extras on context menu status/priority
  items alongside the checkmark for the current value
- Refresh hidden-columns panel to panel-open/close icons and inline the
  count beside the header
- Drop fixed min height on create-task inline editor; tighten activity
  row padding
- Fix Flexbox import in useTaskItemContextMenu (react-layout-kit β†’ @lobehub/ui)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ’„ style(tasks): show topic status icon in chat drawer title

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ› fix(tasks): drop stale AutoSaveHint on task list page

Task list does not save anything, but it reused the global taskSaveStatus from detail page β€” after editing a task, switching back to the list would still show "latest version loaded".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ’„ style(tasks): drop redundant status tag in topic chat drawer title

Status is already expressed by the colored TopicStatusIcon next to the title.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ’„ style(tasks): add tooltip hint for unassigned assignee

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ’„ style(tasks): polish topic chat drawer border and spacing

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ’„ style(tasks): show check before shortcut in context menu extra

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Innei pushed a commit that referenced this pull request Apr 25, 2026
)

* πŸ”₯ feat(tasks): drop per-agent /agent/:aid/tasks routes again

PR #13887 reintroduced the per-agent Tasks surface (sidebar entry, route
files, agentId-scoped breadcrumb/list/board, /agent/:aid/tasks/:taskId
navigation) that #14109 had removed in favor of unified /tasks and
/task/:id. Restore the unified-only model: drop the agent sidebar Tasks
nav item, delete the agent-scoped route files, strip agent-tasks blocks
from both desktopRouter configs, and revert the agentId props and
per-agent navigate paths in AgentTasksPage / KanbanBoard / Breadcrumb /
TaskDetailPage. Preserves #14137's canceled kanban column.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ› fix(agent): redirect any agent sub-route before opening new topic

handleNewTopic only checked /profile and /channel, so on /agent/:aid/page,
/agent/:aid/cron/:cronId or other sub-routes the redirect was skipped and
mutate() opened a new topic on a non-chat screen β€” looking ineffective to
the user. Match useTopicNavigation's pattern: derive an agent base path
from params (with topicId when present) and treat anything longer than
that as a sub-route, so adding new sub-routes never re-introduces this gap.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* πŸ› fix(agent): always push agent chat route before opening new topic

The previous fix conditioned the redirect on isInAgentSubRoute, which
left the URL untouched on /agent/:aid/:topicId β€” opening a new topic
while the URL still pointed at the previous one. Drop the conditional
and always push /agent/:aid: it covers every sub-route (/profile,
/channel, /page, /cron/:cronId, …) and strips any stale :topicId so
the URL matches the freshly opened topic. Restores Nav.test.tsx.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature:agent Assistant/Agent configuration and behavior feature:streaming Streaming response issues feature:tool Tool calling and function execution size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant