Repository navigation
feat: run remote Agent Roles in a Local Project's linked GitHub repo and keep their sidebar nesting - #2027
Merged
Conversation
…itory A Role dispatched from a Local Project to another Machine started as a plain chat because that Machine cannot reach the project's filesystem. When the Local Project's observed GitHub remote is enabled in the workspace, the Role now starts in that repository (default branch), as from a GitHub project. An unlisted repository keeps the plain-chat placement. Model: claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r groups An opened Session whose opener renders in another Workspace group (for example a cross-machine Role chat opened from a Local Project) now moves into the opener's group so the opened-by tree can indent it. Pinned and Updated lists keep natural membership; an opener outside the rendered groups leaves the row where it was. Model: claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mobile project buckets now place an opened Session in its topmost unpinned ancestor's bucket, matching the desktop Workspace groups; a bucket's project heading comes only from its own rows. Date buckets file a whole opened-by tree under the day of its freshest member, the time that already ranks the opener. Model: claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…al-github-project # Conflicts: # packages/components/src/components/mobile/mobile-chat-list.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Problem / pressure
When an Agent Role bound to another Machine is mentioned from a Local Project session, the remote Machine cannot reach the project's filesystem, so MCP creates the Role session as a plain chat with no code. If that Local Project has a GitHub remote that the workspace already enables, the remote Machine could clone it and work like a GitHub-project session.
Separately, in the Workspace sidebar the resulting session lands in another group (Chats or a GitHub repository) than its opener, so the opened-by tree renders it top-level and the fan-out hierarchy is lost.
Summary
apps/cli/src/mcp/lody-mcp-server.ts): if a remote Role has no explicitworkContextand the requester's Local Project has a linked GitHub repository thatresolveRoleCloneableRepofinds enabled in the workspace, the Role session starts in that repository on the default branch. The default branch is used because the local branch may be unpushed and would fail the clone. An unlisted repository keeps the plain-chat placement instead of failing. Same-machine Roles still default to a child Session, and an explicitworkContextstill wins. Applied to single, batch and legacy create paths; the tool description is updated.packages/components):placeOpenedSessionsWithOpenersandplaceWorkspaceSessionsWithOpenersmove an opened Session into the Workspace group of its topmost rendered ancestor, so the tree there indents it. Every row still appears exactly once; Pinned and Updated keep their natural membership. An opener in a hidden project, in Pinned or in the archive leaves the row where it was, and a cycle also stays put. Keyboard-navigation group lookup and the local-project hover card (the row's own machine, not the project's) follow the moved row.mobile/mobile-chat-list.tsx): project buckets apply the same placement, and a bucket's project heading comes only from its own rows. Date buckets put a whole opened-by tree under the day of its freshest member, the same time that already ranks the opener.packages/components/src/components/mobile/AGENTS.md,specs/agent-role-mentions.md(draft),apps/cli/src/mcp/AGENTS.md, the cross-machine Role note (EN/ZH),packages/components/src/components/AGENTS.md,.agents/docs/components-sidebar-session-tree.md(records the rejected alternatives: a cross-machineparentSessionIdchild, and duplicate rows).Visual explanation
flowchart TD A[Local Project session on Machine A<br/>mentions Role bound to Machine B] --> B{explicit workContext?} B -- yes --> W[use it] B -- no --> C{Local Project's GitHub repo<br/>enabled in workspace?} C -- yes --> G[GitHub workContext: repo, default branch<br/>cloned on Machine B] C -- no --> P[plain chat on Machine B] G --> S[openedBySessionId = requester] P --> S S --> T[Workspace sidebar / mobile project buckets:<br/>row moves into opener's group] T --> U[opened-by tree indents it under the opener]Before / after
Test plan
apps/cli:vitest run src/mcp/lody-mcp-server.test.tspasses (50). The new case covers four outcomes: an enabled linked repo gives a GitHub workContext on the default branch, an unlisted repo stays plain chat, an explicit workContext is unchanged, and a same-machine Role is still a child.packages/components: the sidebar, session-list and opened-by test files pass (26 files, 251 tests). New cases cover a remote plain chat nested in the opener's Local Project group, a Local Project Session joining a GitHub group as a task row and indenting there, an unrendered opener that leaves the row in place, and a cycle that stays put.pnpm typecheckpasses. Type-awareoxlinton the changed files reports 0 errors.lint:effect,lint:i18nand allcheck:*boundary scripts, includingcheck:public-boundary, pass.pnpm run docs checkpasses.test:ci.🤖 Generated with Claude Code