Skip to content

fix(cli): allow local session creation on stale Flock sync - #411

Open
UniversePeak wants to merge 1 commit into
LodyAI:mainfrom
UniversePeak:fix/session-flock-sync-best-effort
Open

fix(cli): allow local session creation on stale Flock sync#411
UniversePeak wants to merge 1 commit into
LodyAI:mainfrom
UniversePeak:fix/session-flock-sync-best-effort

Conversation

@UniversePeak

@UniversePeak UniversePeak commented Sep 5, 2026

Copy link
Copy Markdown

Related issue

Closes #398

Problem / pressure

When the machine Flock freshness sync fails during degraded network conditions, MCP/local session creation rejects a project that is already available in the local replica. The remote round trip is a freshness check, not a prerequisite for resolving the local project needed to create the session.

Summary

Keep the existing hard-fail sync helper for callers that require fresh reads, but use a best-effort wrapper for both local-project resolution paths. A failed freshness sync is logged and resolution continues from the local Flock replica.

Before / after

Before After
A Flock freshness timeout/network error aborts local-project resolution and prevents session creation. The failure is logged, local project resolution continues from the replica, and session creation can proceed with locally known inputs.

Test plan

  • corepack pnpm exec vitest run src/commands/session.test.ts --pool=forks --maxWorkers=1 — 65 tests passed.
  • The regression forces syncFlockDocOrThrow to reject with Streams sync failed: network_error and verifies local project resolution still succeeds.
  • git diff --check passed.
  • Full integration verification against a live degraded Streams connection was not run.

Context handoff

Instructions for reviewing agents

  • Review focus: Inspect apps/cli/src/commands/session.ts local-project resolution paths and confirm the best-effort wrapper does not alter agent-config or ACP capability freshness reads.
  • Decisions to challenge: Confirm that CLI and MCP local-project resolution should share this policy because both consume the local replica before session creation.
  • Plausible failures / evidence gaps: The regression covers the resolver boundary with a synthetic network error; a live degraded Streams integration test remains unavailable in this environment.

Authoring context

  • User goal / directives: Fix Issue [Bug] Session create hard-fails on a best-effort Flock freshness sync when the network is degraded #398 so locally resolvable session creation survives transient machine Flock freshness-sync failures.
  • Constraints / non-goals: Keep the change focused; do not make unrelated Flock reads best-effort or add a new MCP offline option.
  • Risk-bearing decisions: Only the two local-project resolution callers switch to best-effort; the original hard-fail helper remains unchanged for other freshness-sensitive reads.
  • Destructive or irreversible behavior: None; the change only logs a failed freshness check and reads the existing local replica.
  • Deliberately not done or tested: No live packet-loss/degraded-Streams integration test was run; the deterministic unit regression covers the failure boundary.
  • Unknowns / confidence: High confidence in the local behavior and regression coverage; live transport behavior still belongs to CI/maintainer verification.

@github-actions github-actions Bot added scope: cli status:needs-pr-attention External PR needs contributor attention before review and removed status:needs-pr-attention External PR needs contributor attention before review labels Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Session create hard-fails on a best-effort Flock freshness sync when the network is degraded

1 participant