Repository navigation
fix(flow): stop blaming a stale engine for a project that is not a repository - #22
Merged
Merged
Conversation
…pository A project folder the server does not recognise as one — most often a folder that is simply not a git repository — answers `GET /api/agent` with zero agents, built-in ones included. Every named card then reads as missing, and the preflight failed the run with the stale-config message: "it reads its config once at boot ... restart". Restarting changes nothing, which is the expensive part — the sentence sounds right, so the next half hour goes into the restart loop rather than into the directory. The run was usually fine. A session resolves its config from the engine's own cwd rather than from OPENFLOW_PROJECT, so the agents were there for the drain the whole time; only the check, which is directory-scoped, disagreed. - `agentsUnscoped()` in `src/server/client.ts` — a second client built with no `directory`, so it reads the list the drain will have. - `unknownAgents` treats an empty list as its own case: it asks the unscoped read before failing anything, and the cards proceed when the names are there. Only when they are not does it stop the run, and then it says `git init`, quotes no restart command, and does not call `onEngineStale` — that dialog offers the one fix that cannot work here. A non-empty list missing one name is still the ordinary stale-config case and still says restart. - `mergeAgents` in `src/app.tsx` splits the same two cases after a write. - A host with no unscoped read (an older build, a test double) keeps the old message, which is the right answer whenever the directory is a real project. Measured against a live engine 2026-09-08: a non-git directory returned 0 agents, this repo returned 49, and the same read with no directory header returned the same 49. Four tests in `engine.test.ts` pin both branches and the two cases that must not change. Full suite 1045 pass, 0 fail; typecheck clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
A project folder the server does not recognise as one — most often a folder that is simply not a git repository — answers
GET /api/agentwith zero agents, built-in ones included. Every named card then read as missing, and preflight failed the run with the stale-config message:Restarting changes nothing. That is the expensive part: the sentence sounds right, so the next half hour goes into the restart loop rather than into the directory.
The run was usually fine. A session resolves its config from the engine's own cwd rather than from
OPENFLOW_PROJECT, so the agents were there for the drain the whole time — only the check, which is directory-scoped, disagreed. Same split FLOW.md already documents for agents, skills and provider overrides, surfacing in the check rather than the run.What changed
agentsUnscoped()(src/server/client.ts) — a second client built with nodirectory, so it reads the list the drain will actually have.unknownAgentstreats an empty list as its own case. It asks the unscoped read before failing anything, and the cards proceed when the names are there. Only when they are not does it stop the run — and then it saysgit init, quotes no restart command, and does not callonEngineStale, because that dialog offers the one fix that cannot work here.mergeAgents(src/app.tsx) splits the same two cases after a write.Measured
Against a live
opencode serveon :4096, 2026-09-08:x-opencode-directory: <non-git temp dir>x-opencode-directory: C:/Users/seara/OpenFlowVerification
Four tests in
engine.test.tspin both new branches and the two cases that must not change: the drain rescuing an empty scoped list,git initwith noonEngineStalewhen it does not, and a missing name in a non-empty list still saying restart.bun test— 1045 pass, 0 fail.bun run typecheck— clean.🤖 Generated with Claude Code