fix(build): bundle archetype-catalog.json into the wheel + desktop sidecar#2115
Conversation
…decar
Cowork was missing from the new-agent picker on the desktop app and on any
`pip install` — but present in Docker. The archetype itself was never broken:
`config/archetype-catalog.json` simply never reached either packaged build.
Both asset lists are hand-maintained and neither had it:
• hatch_build.py::_SEEDS — the wheel (PyPI, and the
desktop sidecar built from it)
• apps/desktop/sidecar/build_sidecar.py::BUNDLED_DATA — PyInstaller
Verified against the published 0.106.0 wheel: it ships
`config/soul-presets/cowork.md` (the persona) but no archetype-catalog.json — so
the SOUL was there and the entry that makes it selectable wasn't.
What made it invisible: `_load_archetype_catalog` falls back to Basic + Custom
when the file is absent and logs nothing. The picker renders fine and just
quietly offers less than the source tree does. Docker was unaffected because its
image copies the repo wholesale, so it reproduced only on desktop/PyPI — which
reads as a platform quirk rather than a packaging bug.
This is the THIRD time this exact shape has shipped. The comments in
build_sidecar.py record the other two: plugin-catalog.json ("0 official
plugins") and mcp-catalog.json ("no servers match"), each fixed reactively with
a comment and no guard. The pattern is structural — catalogs are data, adding
one means editing the repo (Docker keeps working) while forgetting two lists
whose readers fail soft.
So tests/test_bundled_config_assets.py asserts over a GLOB, not a hardcoded
list: every config/*catalog*.json must appear in both asset lists, and the two
must agree with each other (drift ships a catalog to PyPI but not desktop, so
the bug reproduces on exactly one surface). A catalog added tomorrow is covered
without anyone remembering the test exists. Confirmed it fails on the
pre-fix tree (3 failures) and passes after.
Locally rebuilt wheel now contains ['basic', 'cowork', 'custom'].
NOTE: this is a packaging fix only. The three fleet agents that mount a named
volume over /opt/protoagent/config (jon, frank, vera) have a separate, unrelated
cause — Docker seeds a named volume from the image once, so their config froze
on Jul 4 — and need a deployment change, not this.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
WalkthroughThe archetype catalog is added to Hatch wheel packaging and the desktop sidecar bundle. New tests statically inspect both asset definitions and verify that all catalog files, including ChangesCatalog packaging
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
QA panel review — PASS
code-review-structural · head 710579ceb64d · formal
[review-synthesizer completed: workflow code-review-structural:report]
The PR is low-risk as it primarily involves updating a seed list for the archetype catalog. The verifier refuted the only reported finding, noting that the structural analysis engine flagged a logic error that does not exist within the scope of this diff. No other findings were reported by the panel.
Gaps: No structural analysis findings survived verification; the change is limited to a data update in hatch_build.py.
[]…rtifacts, fleet inputs/secrets (#2130) Bump 0.106.0 → 0.107.0 and roll the changelog for the release. Highlights: - Versioned file artifacts + save_file_artifact (ADR 0092 D2, #2126) - Document-generation stack baked into the desktop bundle (ADR 0092 D1, #2123) - Fleet agents accept operator inputs + secrets at create time (#2121/#2122/#2125/#2127) - Deterministic persona-drift detection (#2116) - Chat tab context menu Close Others/Left/Right (#2112) - Fixes: archetype-catalog bundling (#2115), PyPI publishes on tag push (#2113) Backfilled [Unreleased] entries for the feature PRs that lacked them, rolled to [0.107.0], scaffolded + polished the marketing changelog. uv.lock: project version line only (surgical — avoids uv 0.11.13-vs-pinned-0.11.29 marker drift). Claude-Session: https://claude.ai/code/session_01EVmWoy2TdXdMshNn5WBR2Z Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cowork is missing from the new-agent picker on the desktop app and on
pip install, but present in Docker.The archetype was never broken.
config/archetype-catalog.jsonsimply never reached either packaged build.Evidence
The published 0.106.0 wheel contains:
So the SOUL preset was there and the entry that makes it selectable wasn't. Neither hand-maintained asset list had it:
hatch_build.py::_SEEDS— the wheel (PyPI, and the desktop sidecar built from it)apps/desktop/sidecar/build_sidecar.py::BUNDLED_DATA— PyInstallerWhy nobody caught it
_load_archetype_catalog(operator_api/fleet_routes.py:307) falls back to Basic + Custom when the file is absent, and logs nothing. The picker renders fine and just quietly offers less than the source tree does.Docker was unaffected — its image copies the repo wholesale — so it reproduced only on desktop/PyPI, which reads as a platform quirk rather than a packaging bug.
This is the third time
build_sidecar.py's own comments record the other two:plugin-catalog.jsonmcp-catalog.jsonarchetype-catalog.jsonThe pattern is structural: catalogs are data, so adding one means editing the repo (Docker keeps working) while forgetting two lists whose readers fail soft.
The guard
tests/test_bundled_config_assets.pyasserts over a glob, not a hardcoded list — everyconfig/*catalog*.jsonmust appear in both asset lists, and the two must agree with each other (drift ships a catalog to PyPI but not desktop, reproducing the bug on exactly one surface). A catalog added tomorrow is covered without anyone remembering the test exists. There's also a guard-the-guard test so a glob that matches nothing can't pass vacuously.Confirmed it fails on the pre-fix tree (3 failures) and passes after.
Testing
ruffclean · 3908 Python tests · locally rebuilt wheel now contains['basic', 'cowork', 'custom'].Not covered by this PR
Three fleet agents (jon, frank, vera) are also missing Cowork, from an unrelated cause: their compose mounts a named volume over
/opt/protoagent/config. Docker seeds a named volume from the image only on first creation, so their config froze on Jul 4 — before Cowork landed — and no image update can reach it.langgraph-config.example.yamlis stale there too. That needs a deployment change in homelab-iac, not a code change.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests