Skip to content

โœจ chore(agent): agencyConfig contract + git-over-RPC backend#15542

Merged
arvinxx merged 4 commits into
canaryfrom
feat/agent-device-backend
Jun 8, 2026
Merged

โœจ chore(agent): agencyConfig contract + git-over-RPC backend#15542
arvinxx merged 4 commits into
canaryfrom
feat/agent-device-backend

Conversation

@arvinxx

@arvinxx arvinxx commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

Backend base layer โ€” pure infrastructure that's safe to merge first because it changes no existing runtime behavior. Two kinds of dormant additions only:

  1. Type contract โ€” agencyConfig.workingDirByDevice (per-device cwd) + agencyConfig.executionTarget, and DeviceGitInfo. Type declarations; nothing consumes them on this branch.
  2. git-over-RPC capability (dormant endpoints) โ€” @lobechat/local-file-shell/git (one shared impl), desktop GitCtr.gitInfo() + RPC dispatch registration, deviceGateway.gitInfo() + device.gitInfo TRPC query. No client caller yet.

โš ๏ธ The runtime-decision wiring (server tool gate deriving runtimeMode from executionTarget, and aiAgent cwd precedence consuming workingDirByDevice) is intentionally NOT here โ€” it changes default execution logic, so it ships in the UI PR (#15543) to be reviewed/validated as one unit.

Change Type

  • โœจ New feature (backend contract + dormant endpoints; no behavior change)

How to Test

  • bun run type-check passes.
  • No existing code path changes on canary โ€” git endpoints are additive and uncalled; agencyConfig fields are unread.

Closes LOBE-10094
Part of LOBE-10093

@vercel

vercel Bot commented Jun 8, 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 Jun 8, 2026 9:58am

Request Review

@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jun 8, 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 platform:desktop Desktop client labels Jun 8, 2026

@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: 97fd736e89

โ„น๏ธ 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 thread src/server/modules/Mecha/AgentToolsEngine/index.ts Outdated
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

โŒ Patch coverage is 23.33333% with 23 lines in your changes missing coverage. Please review.
โœ… Project coverage is 70.56%. Comparing base (419aca2) to head (a3cc180).
โš ๏ธ Report is 5 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff             @@
##           canary   #15542      +/-   ##
==========================================
- Coverage   70.57%   70.56%   -0.01%     
==========================================
  Files        3303     3303              
  Lines      326110   326141      +31     
  Branches    29763    29767       +4     
==========================================
  Hits       230140   230140              
- Misses      95787    95818      +31     
  Partials      183      183              
Flag Coverage ฮ”
app 61.30% <23.33%> (-0.01%) โฌ‡๏ธ
database 92.22% <รธ> (รธ)
packages/agent-manager-runtime 49.69% <รธ> (รธ)
packages/agent-runtime 81.06% <รธ> (รธ)
packages/builtin-tool-lobe-agent 18.52% <รธ> (รธ)
packages/context-engine 84.25% <รธ> (รธ)
packages/conversation-flow 91.29% <รธ> (รธ)
packages/device-gateway-client 90.18% <รธ> (รธ)
packages/eval-dataset-parser 95.15% <รธ> (รธ)
packages/eval-rubric 76.11% <รธ> (รธ)
packages/fetch-sse 85.57% <รธ> (รธ)
packages/file-loaders 87.89% <รธ> (รธ)
packages/memory-user-memory 74.99% <รธ> (รธ)
packages/model-bank 99.99% <รธ> (รธ)
packages/model-runtime 84.22% <รธ> (รธ)
packages/prompts 72.51% <รธ> (รธ)
packages/python-interpreter 92.90% <รธ> (รธ)
packages/ssrf-safe-fetch 0.00% <รธ> (รธ)
packages/types 35.23% <รธ> (รธ)
packages/utils 84.98% <รธ> (รธ)
packages/web-crawler 88.08% <รธ> (รธ)

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

Components Coverage ฮ”
Store 68.37% <42.85%> (-0.01%) โฌ‡๏ธ
Services 54.90% <รธ> (รธ)
Server 71.42% <23.33%> (-0.03%) โฌ‡๏ธ
Libs 54.45% <รธ> (รธ)
Utils 81.93% <รธ> (รธ)
๐Ÿš€ 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.

arvinxx and others added 2 commits June 8, 2026 13:15
โ€ฆTarget

Type-only contract for the unified per-device working-directory work. Adds
`workingDirByDevice` (per-device cwd) and `executionTarget` to agencyConfig.
No runtime logic consumes them yet โ€” the server/client wiring lands in the UI
PR so it can be validated as one unit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
โ€ฆimpl

Backend/RPC capability for "git branch / changes / PR for remote devices".
Dormant โ€” no client caller yet; merging changes no existing behavior.

- `@lobechat/local-file-shell/git`: repoType + branch / linked-PR / working-tree
  / ahead-behind + `gitInfo` aggregate + `DeviceGitInfo` type (desktop + CLI).
- desktop `GitCtr.gitInfo()` (@IpcMethod) delegates to it; registered in
  GatewayConnectionCtr's RPC dispatch. `utils/git` re-exports the helpers.
- server: `deviceGateway.gitInfo()` wrapper + `device.gitInfo` TRPC query.
- `@lobechat/types`: `DeviceGitInfo` shape.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arvinxx arvinxx force-pushed the feat/agent-device-backend branch from 97fd736 to 331cba7 Compare June 8, 2026 05:16
arvinxx added a commit that referenced this pull request Jun 8, 2026
โ€ฆe UI

Client UI consuming the backend contract (#15542). User-facing โ€” validate
before merge.

- New `src/store/device` (SWR fetch + cwd writes) โ€” single source of device data;
  `deviceCwd` helper moves here from the chat-input feature layer.
- One `WorkingDirectoryPicker` for local + remote (native dialog vs manual path).
- Shared `WorkspaceControls` strip composed by both chat-input bars.
- GitStatus reads remote git via `useDeviceGitInfo` (read-only).
- Execution-device switcher graduates out of labs โ†’ writes only executionTarget.
- One-time migration of legacy localStorage recents into device.workingDirs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arvinxx arvinxx changed the title โœจ feat(agent): device cwd-resolution + git-over-RPC backend contract โœจ feat(agent): agencyConfig contract + git-over-RPC backend (dormant, no runtime wiring) Jun 8, 2026
โ€ฆhell

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
arvinxx added a commit that referenced this pull request Jun 8, 2026
โ€ฆe UI

Client UI consuming the backend contract (#15542). User-facing โ€” validate
before merge.

- New `src/store/device` (SWR fetch + cwd writes) โ€” single source of device data;
  `deviceCwd` helper moves here from the chat-input feature layer.
- One `WorkingDirectoryPicker` for local + remote (native dialog vs manual path).
- Shared `WorkspaceControls` strip composed by both chat-input bars.
- GitStatus reads remote git via `useDeviceGitInfo` (read-only).
- Execution-device switcher graduates out of labs โ†’ writes only executionTarget.
- One-time migration of legacy localStorage recents into device.workingDirs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
arvinxx added a commit that referenced this pull request Jun 8, 2026
โ€ฆe UI

Client UI consuming the backend contract (#15542). User-facing โ€” validate
before merge.

- New `src/store/device` (SWR fetch + cwd writes) โ€” single source of device data;
  `deviceCwd` helper moves here from the chat-input feature layer.
- One `WorkingDirectoryPicker` for local + remote (native dialog vs manual path).
- Shared `WorkspaceControls` strip composed by both chat-input bars.
- GitStatus reads remote git via `useDeviceGitInfo` (read-only).
- Execution-device switcher graduates out of labs โ†’ writes only executionTarget.
- One-time migration of legacy localStorage recents into device.workingDirs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arvinxx arvinxx force-pushed the feat/agent-device-backend branch from ba5611a to 92383e3 Compare June 8, 2026 07:02
arvinxx added a commit that referenced this pull request Jun 8, 2026
โ€ฆe UI

Client UI consuming the backend contract (#15542). User-facing โ€” validate
before merge.

- New `src/store/device` (SWR fetch + cwd writes) โ€” single source of device data;
  `deviceCwd` helper moves here from the chat-input feature layer.
- One `WorkingDirectoryPicker` for local + remote (native dialog vs manual path).
- Shared `WorkspaceControls` strip composed by both chat-input bars.
- GitStatus reads remote git via `useDeviceGitInfo` (read-only).
- Execution-device switcher graduates out of labs โ†’ writes only executionTarget.
- One-time migration of legacy localStorage recents into device.workingDirs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arvinxx arvinxx changed the title โœจ feat(agent): agencyConfig contract + git-over-RPC backend (dormant, no runtime wiring) โœจ chore(agent): agencyConfig contract + git-over-RPC backend (dormant, no runtime wiring) Jun 8, 2026
@arvinxx arvinxx changed the title โœจ chore(agent): agencyConfig contract + git-over-RPC backend (dormant, no runtime wiring) โœจ chore(agent): agencyConfig contract + git-over-RPC backend Jun 8, 2026
deviceGateway is a device-scoped gateway client (status/list/tool-call/git/
workspace RPC), not tool-execution-specific. Move it out of toolExecution/
into its own services/deviceGateway/ and update all import sites.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arvinxx arvinxx force-pushed the feat/agent-device-backend branch from 92383e3 to a3cc180 Compare June 8, 2026 09:47
arvinxx added a commit that referenced this pull request Jun 8, 2026
โ€ฆe UI

Client UI consuming the backend contract (#15542). User-facing โ€” validate
before merge.

- New `src/store/device` (SWR fetch + cwd writes) โ€” single source of device data;
  `deviceCwd` helper moves here from the chat-input feature layer.
- One `WorkingDirectoryPicker` for local + remote (native dialog vs manual path).
- Shared `WorkspaceControls` strip composed by both chat-input bars.
- GitStatus reads remote git via `useDeviceGitInfo` (read-only).
- Execution-device switcher graduates out of labs โ†’ writes only executionTarget.
- One-time migration of legacy localStorage recents into device.workingDirs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arvinxx arvinxx merged commit 235a16f into canary Jun 8, 2026
33 of 34 checks passed
@arvinxx arvinxx deleted the feat/agent-device-backend branch June 8, 2026 10:09
arvinxx added a commit that referenced this pull request Jun 8, 2026
โ€ฆe UI

Client UI consuming the backend contract (#15542). User-facing โ€” validate
before merge.

- New `src/store/device` (SWR fetch + cwd writes) โ€” single source of device data;
  `deviceCwd` helper moves here from the chat-input feature layer.
- One `WorkingDirectoryPicker` for local + remote (native dialog vs manual path).
- Shared `WorkspaceControls` strip composed by both chat-input bars.
- GitStatus reads remote git via `useDeviceGitInfo` (read-only).
- Execution-device switcher graduates out of labs โ†’ writes only executionTarget.
- One-time migration of legacy localStorage recents into device.workingDirs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
arvinxx added a commit that referenced this pull request Jun 8, 2026
โ€ฆe UI

Client UI consuming the backend contract (#15542). User-facing โ€” validate
before merge.

- New `src/store/device` (SWR fetch + cwd writes) โ€” single source of device data;
  `deviceCwd` helper moves here from the chat-input feature layer.
- One `WorkingDirectoryPicker` for local + remote (native dialog vs manual path).
- Shared `WorkspaceControls` strip composed by both chat-input bars.
- GitStatus reads remote git via `useDeviceGitInfo` (read-only).
- Execution-device switcher graduates out of labs โ†’ writes only executionTarget.
- One-time migration of legacy localStorage recents into device.workingDirs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
arvinxx added a commit that referenced this pull request Jun 8, 2026
โ€ฆe UI (#15543)

* โœจ feat(agent): unified per-device working directory + execution-device UI

Client UI consuming the backend contract (#15542). User-facing โ€” validate
before merge.

- New `src/store/device` (SWR fetch + cwd writes) โ€” single source of device data;
  `deviceCwd` helper moves here from the chat-input feature layer.
- One `WorkingDirectoryPicker` for local + remote (native dialog vs manual path).
- Shared `WorkspaceControls` strip composed by both chat-input bars.
- GitStatus reads remote git via `useDeviceGitInfo` (read-only).
- Execution-device switcher graduates out of labs โ†’ writes only executionTarget.
- One-time migration of legacy localStorage recents into device.workingDirs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โœจ feat(agent): wire executionTargetโ†’runtimeMode + workingDirByDevice cwd

The runtime-decision wiring, kept out of the backend contract PR so it's
reviewed/validated together with the UI that drives it.

- `helpers/executionTarget`: resolveRuntimeMode / executionTarget resolvers.
- server tool gate (AgentToolsEngine) derives runtimeMode from
  `agencyConfig.executionTarget`, with a no-regression fallback to the legacy
  per-platform runtimeMode.
- server cwd precedence (aiAgent resolveWorkspaceInit + hetero dispatch) now
  consumes `workingDirByDevice[targetDeviceId]`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โœ… test(agent): cover executionTarget + workingDir helpers; drop dead lab key

- Unit-test resolveRuntimeMode / resolveExecutionTarget and the working-dir
  precedence (locks the web defaultโ†’cloud graduation + legacy fallback)
- Remove the now-unused `executionDeviceSwitcher` lab i18n keys (toggle deleted)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): guide web users to the desktop app in the device switcher

On web with no remote device, replace the muted "no devices" dead-end with a
prominent, clickable download-desktop card (and drop the now-duplicate header
link). Desktop keeps the muted hint since local execution is already available.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): fix execution-device copy for desktop + web

- Desktop "no devices" hint no longer tells an already-on-desktop user to
  "install the desktop app" โ€” just points at `lh connect`.
- Tighten the web download-card description to the desktop's real benefit
  (run on your computer with local file access).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): flatten the web download card to a plain row

Drop the outer border/background so it reads as a normal menu row (like the
sandbox option), and shorten the description to a single line so the row stops
being taller than its neighbours.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): reword download-card desc to "access to your computer"

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โœจ feat(agent): add "no device" execution target (plain chat, no run tools)

Restores the option to run an agent with no execution environment, lost when
the per-platform runtimeMode was unified into executionTarget. Adds `none` to
HeteroExecutionTarget (โ†’ runtimeMode `none`), surfaces it at the top of the
switcher on both web + desktop, and flips the web default back to `none` so an
unconfigured web agent is plain chat again (desktop still defaults to local).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): rename HeteroExecutionTargetโ†’DeviceExecutionTarget, reorder switcher

- Rename the type (it now carries `none`, so "device" target fits better than
  "hetero") across types + helpers + dispatcher + switcher.
- Move "no device" to the bottom of the list (real targets first, opt-out last).
- Reword the download card to "let agents connect directly to your computer".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): move "no device" back to top, restore EN download copy

"No device" sits above the dynamic device rows; keep the EN download-card
wording as "Run agents with access to your computer".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): swap switcher icons โ€” MonitorOff for "no device", Box for sandbox

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): clarify execution-device info tooltip + "no device" desc

- Info tooltip now explains the cloud sandbox is provided by the centralized
  LobeHub Marketplace, and that picking a device makes it the agent's runtime
  for reading/writing files and operating the computer.
- "No device" description now conveys "no device enabled, can't operate a
  computer" instead of "plain chat".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): move info icon beside the title, shorten "no device" desc

- Info tooltip trigger now sits next to the "Execution Device" title instead of
  right-aligned; the download link stays on the right.
- "No device" description trimmed to just "No device enabled".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): zh tooltip wording โ€” "ๆไพ›ๆœๅŠก"

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): reorder tooltip โ€” device runtime first, marketplace last

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): trim tooltip โ€” drop "่ฎพๅค‡"/devices and trailing period

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): tag the current machine's device row, drop duplicate "This device"

When the desktop's own machine appears in the device list, badge that real row
with a "This device" tag and hide the generic "This device" (local) option โ€”
no more two entries for the same machine. The local option still shows as a
fallback when the machine isn't enrolled in the list yet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ feat(agent): hoist this-machine device above sandbox + auto-bind on first run

Switcher-only (no routing/dispatch changes):
- Order is now: no device โ†’ this device โ†’ cloud sandbox โ†’ other devices.
- On desktop, when this machine is enrolled and online and the agent has no
  explicit target yet, default to it and persist the binding once.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): widen gap between execution-device rows

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): hide "Get Desktop App" link on desktop

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): capitalize "Cloud Sandbox" label

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ feat(agent): web working-dir entry via "Add folder" modal instead of inline input

The browser folder picker can't yield an absolute path (sandboxed handle), so
on web / a remote device the working directory is entered manually. Replace the
inline input with an "Add folderโ€ฆ" row that opens a modal for absolute-path
entry; the local desktop machine still opens the native folder dialog.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โ™ป๏ธ refactor(agent): split working-dir footer into local/remote row components

Replace the scattered `isLocalDevice ?` forks (icon, label, handler) with one
branch that picks between two self-contained rows: ChooseLocalFolderRow (native
dialog) and AddRemoteFolderRow (absolute-path modal).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): use the device default cwd as the add-folder placeholder

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โœจ feat(agent): validate manually-entered working dir via device statPath RPC

Web / remote clients can't browse the target device's filesystem, so the
"Add folder" modal now checks the typed path on the device before binding it.
New `statPath` device RPC mirrors gitInfo end-to-end:
- desktop WorkspaceCtr.statPath (fs.stat โ†’ exists / isDirectory) + RPC dispatch
- server deviceGateway.statPath + device.statPath tRPC (invokeRpc relay)
- modal blocks on a definitive negative (not found / not a directory); an
  unreachable device is treated as "can't verify" and allowed through

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โ™ป๏ธ refactor(agent): route statPath through deviceService, not lambdaClient

Components shouldn't import lambdaClient directly โ€” add a thin deviceService
wrapping device.statPath, and call it from the working-dir picker.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โ™ป๏ธ refactor(i18n): move working-directory strings from plugin to a device ns

The working-directory / git control-bar strings (53 keys) were lumped under the
`plugin` namespace. Move them to a dedicated `device` namespace and drop the
now-redundant `localSystem.` prefix (`plugin:localSystem.workingDirectory.X` โ†’
`device:workingDirectory.X`). Updates the 4 consumer components; the `device`
ns auto-registers via defaultResources.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โ™ป๏ธ refactor(agent): route all device TRPC calls through deviceService

Components/hooks/stores shouldn't reach into lambdaClient.device.* directly.
Expand deviceService with listDevices/updateDevice/listGitBranches/
checkoutGitBranch/checkCapability/getAgentProfile and migrate every imperative
call site (device store, BranchSwitcher, CreatePlatformAgent, the remote-agent
guard, RemoteAgentConfigCard) + the DeviceListItem type. lambdaQuery.device.*
React-Query hooks are left as-is (a different pattern).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โœจ feat(agent): pull/push a remote device's branch over RPC

Wire git pull/push through the device's pullGitBranch/pushGitBranch RPC so the
web/remote GitStatus bar can sync, not just the local desktop over IPC. Shows
the pull/push affordances for remote devices too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โ™ป๏ธ refactor(agent): route git pull/push through deviceService too

Add pullGitBranch/pushGitBranch to deviceService and switch GitStatus off the
direct lambdaClient.device.* calls, so no component reaches the device router
directly anymore.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ› fix(agent): detect repoType for manually-added working dirs

A directory added via the "Add folder" modal committed without a repoType, so a
GitHub repo showed a plain folder icon. statPath now also returns the git repo
type (detected on the target device); the modal threads it into the committed
entry. Collapses the modal's separate validate+submit into one onSubmit that
validates and enriches in a single round-trip.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ style(agent): create new branch via a modal instead of inline footer

"Checkout new branchโ€ฆ" now opens a focused modal (branch-name input + create)
rather than expanding an inline footer inside the branch dropdown. Always
creates + checks out the branch โ€” no checkout/overwrite options. Errors show
inline in the modal; drops the dead inline-create state/styles.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โ™ป๏ธ refactor(agent): route all git ops through a unified gitService

Pick Electron IPC vs device RPC inside the service so UI / store / hooks
stay transport-agnostic. Replace the bundled `gitInfo` device RPC with
granular reads (branch / linked PR / working-tree / ahead-behind) that
mirror the local IPC methods one-to-one, and move the git read SWR hooks
into the device store (useFetchGitInfo / WorkingTreeStatus / AheadBehind).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โœจ feat(agent): route Review git ops through device RPC (remote-capable)

Extend the device-RPC git pipeline to the 4 ops the Review panel needs
(getGitWorkingTreePatches / getGitBranchDiff / listGitRemoteBranches /
revertGitFile), mirroring the listGitBranches pattern end-to-end: desktop RPC
dispatch โ†’ deviceGateway โ†’ device.* tRPC โ†’ gitService. Adds minimal DeviceGit*
mirror types to @lobechat/types. Review (useReviewPatches / useGitRemoteBranches
/ FileItem) now goes through gitService with a deviceId, dropping the isDesktop
gate so web/remote devices get the diff + revert too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ› fix(agent): resolve repoType from device store so remote Review tab shows

useRepoType now reads the persisted workingDirs[].repoType from the device
store (keyed by deviceId), so a remote device's git/github type โ€” and thus the
Review tab visibility โ€” resolves without a local-only IPC probe. The IPC probe
+ localStorage fallback are kept only when the target is the local machine.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ๐Ÿ’„ feat(agent): optimistic branch switch in the branch switcher

Flip the displayed branch the instant a checkout is clicked (or a new branch
created) instead of waiting for the IPC/RPC round-trip + gitInfo refetch. The
git-info SWR cache is optimistically updated and reconciled on completion โ€” a
failed checkout rolls the label back and toasts the error.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* โœจ feat: support remote device files panel

* ๐Ÿ’„ style: restore desktop this-device option

* ๐Ÿ› fix: keep files panel local for this device

---------

Co-authored-by: Claude Opus 4.8 <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 platform:desktop Desktop client size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant