Repository navigation
fix(og): adopt a differently-cased project instead of duplicating it - #18
Merged
Merged
Conversation
ensure_project looked the project up by exact name, so a project named "Hivemind" was missed by an agent named "hivemind" and og POSTed a second one, leaving two identical-looking folders in the sidebar. Match case-insensitively and adopt the existing project, renaming it to the canonical name when the case differs. A 409 on that rename (another project already holds the canonical name) keeps the adopted project's own name rather than failing; the printed name is whatever the project ended up called, so the composer URL still points at a real project. Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
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.
Why
ensure_project()looked the Omnigent project up by exact name:nameis${OG_PROJECT:-$AGENT_NAME}. On a machine where a project namedHivemindalready existed andagent_namewashivemind, that lookup missedand
ogPOSTed a second project. Both then rendered in the Omnigentsidebar as near-identical folders, and neither side ever cleaned up the other —
observed in the wild for ~2 weeks, with sessions accumulating in both.
ogkept re-pinning the lowercase one while anything started from the sidebar
landed in the other.
What
Case-insensitive lookup, then adopt rather than duplicate:
casefold(); prefer the exact-case project, else the lowestidso a rerun adopts the same one regardless of server response order.
canonical name via
PATCH /v1/projects/{id}. That route 409s when anotherof the caller's projects already holds the name — swallow only 409 and keep
the adopted project's existing name.
POSTa new project only when there is no case-insensitive match.requested one. The caller builds
OG_PUBLIC_URL=".../?project=$proj"fromit, so printing a name the server does not have would silently break the
composer deep-link.
bin/ogonly, +28/-3. The agent/workspace/host pinning block and itsre-pin-every-start behaviour are untouched.
Verification
bash -n bin/og— passpy_compile— pass (bash -ncannot catch Pythonsyntax inside the heredoc)
python3 -m pytest tests/ -q— 293 passedproject list: exact match, case-only difference, no match, multiple matches,
the rename-409 sub-case, non-409 propagation, and a rerun for idempotency.
The sandboxed installer gate in AGENTS.md does not apply — no
installer/ortemplate files are touched. No automated test covers
ensure_project(); it isPython embedded in a bash heredoc, which this repo's pytest suite does not
reach.
Review
cross-vendor-review: passed
Implemented by a deepseek-pinned worker, reviewed independently by an
OpenAI-pinned reviewer with no blocking findings. The reviewer traced the
original bug case, the 409 path, every post-rename use of the stale in-memory
projdict, the tie-break, the two sequential PATCHes, and idempotency onrerun. Two unreachable edges it raised and I am recording rather than fixing:
identical project ids would make the
min()tie-break fall back to serverresponse order, and a null stored
namewould be reported as""withoutreconciliation — neither is a state this API produces.
🤖 Generated with Claude Code