Skip to content

fix(cli): list remote machine projects without daemon - #587

Merged
Leeeon233 merged 1 commit into
LodyAI:mainfrom
Dante-dan:fix/582-remote-project-list
Sep 24, 2026
Merged

Leeeon233 merged 1 commit into
LodyAI:mainfrom
Dante-dan:fix/582-remote-project-list

Conversation

@Dante-dan

@Dante-dan Dante-dan commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

Closes #582

Problem / pressure

lody project list always uses local-daemon IPC, even though authenticated session creation can already synchronize and read a selected remote machine's local-project catalog. A headless client with credentials but no daemon can therefore dispatch work to a remote machine only if it already knows a project selector; it cannot list the available projects through a stable CLI contract.

Summary

Add --workspace and --machine selectors to lody project list. Selector-free calls retain the existing local-daemon behavior, while an explicit selector uses the authenticated one-shot workspace path, resolves the selected machine, synchronizes its Flock document, and returns the same merged local-project catalog used by session creation.

The remote path verifies machine and per-project access before returning paths. It fails closed on authorization or synchronization errors, supports machine ids and unique names, and preserves JSON and terminal-table response behavior. The CLI reference and bilingual Agent Note document the resulting boundary.

Visual explanation

flowchart TD
  A[lody project list] --> B{workspace or machine selector?}
  B -- no --> C[Existing local-daemon IPC]
  B -- yes --> D[Authenticated one-shot workspace manager]
  D --> E[Resolve authorized machine]
  E --> F[Sync target machine Flock]
  F --> G[Read merged local-project catalog]
  G --> H[Filter project access]
  H --> I[JSON or terminal table]
Loading

Before / after

Before After
project list requires a daemon on the client machine. Explicit workspace or machine selectors list the authorized remote machine catalog without local-daemon IPC.
Headless callers infer project choices from a failing session create error. Headless callers receive a structured local-project/list response.
Remote catalog synchronization and access filtering exist only in session creation. Project listing applies the same Flock-backed catalog and capability checks.

Test plan

  • corepack pnpm --filter lody exec vitest run src/lib/remote-local-project-list.test.ts — 4 tests passed.
  • corepack pnpm --filter lody run typecheck — passed.
  • corepack pnpm --filter lody run format:check — passed.
  • node scripts/docs/main.mjs check — passed with existing translation and Agent-instruction size warnings.
  • git diff --check upstream/main...HEAD — passed.

Context handoff

Instructions for reviewing agents

  • Review focus: Inspect selector routing in apps/cli/src/commands/project.ts and the sync/access order in remote-local-project-list.ts.
  • Decisions to challenge: Confirm that selector-free listing should preserve local IPC while every explicit workspace or machine selector opts into the remote catalog.
  • Plausible failures / evidence gaps: The regression fixture exercises distinct synthetic client/target machines and Flock synchronization; it does not connect to a live hosted workspace.

Authoring context

  • User goal / directives: Issue [Bug] lody project list requires the local daemon; there is no daemon-free way to list a remote machine's local projects (which session create --local-project already resolves via the backend) #582 asks for a supported daemon-free remote project-list command; Dante-dan authorized the tracker to investigate eligible issues and publish validated fixes under each repository's current rules.
  • Constraints / non-goals: Preserve the existing selector-free local workflow; do not change session creation, agent-config listing, daemon identity routing, or hosted backend contracts.
  • Risk-bearing decisions: Machine and project capability checks run before paths are returned, and synchronization failure aborts rather than serving a stale catalog.
  • Destructive or irreversible behavior: The command is read-only; it creates no session, changes no project registration, and performs no migration or cleanup.
  • Deliberately not done or tested: No live hosted-workspace or installed-binary test was run; the remote transport, Flock merge, denial, ambiguity, and failure paths are covered with synthetic fixtures.
  • Unknowns / confidence: Confidence is high in the CLI boundary and deterministic catalog behavior; live service availability remains outside the repository-local fixture.

Original user prompt

Show original prompt
#582 / PR #587:CLI 无本地 daemon 时,也能按 workspace/machine 列出远端项目,保持原有本机行为

Model: gpt-5.6-sol
Signed-off-by: Dante <duanjl.china@gmail.com>
@Dante-dan
Dante-dan marked this pull request as ready for review September 10, 2026 22:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-10T22:45:18.653175Z 276cca5 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the status:needs-pr-attention External PR needs contributor attention before review label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@Dante-dan, this pull request needs updates before review.

It is marked status:needs-pr-attention. Address the findings below by 2026-09-28 09:18:50 UTC. The label and this comment are removed automatically after the PR passes validation.

If the PR remains invalid for 7 days, it will be closed and marked status:pr-policy-expired. Continue afterward by opening a new pull request with the current template.

Policy findings
PR does not meet Lody contribution requirements:

- Context handoff must include ### Shared conversation.

See `CONTRIBUTING.md` and `.github/PULL_REQUEST_TEMPLATE.md`.

@Leeeon233

Copy link
Copy Markdown
Contributor

LGTM

@Leeeon233
Leeeon233 merged commit fd98a40 into LodyAI:main Sep 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: cli scope: docs status:needs-pr-attention External PR needs contributor attention before review

Projects

None yet

2 participants