Skip to content

fix: PLUGIN_VERSION drifted from package.json, and config omitted defaults.color - #19

Merged
motin merged 3 commits into
mainfrom
fix/plugin-version-drift
Aug 27, 2026
Merged

fix: PLUGIN_VERSION drifted from package.json, and config omitted defaults.color#19
motin merged 3 commits into
mainfrom
fix/plugin-version-drift

Conversation

@motin

@motin motin commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Two loose ends spotted while installing the published tabby-cctabs 0.1.4 on a real fleet.

PLUGIN_VERSION drifted, again

Published tabby-cctabs@0.1.4 ships with PLUGIN_VERSION = '0.1.5', so /api/health — and therefore cctabs doctor — reports a version that was never published:

$ npm pack tabby-cctabs@0.1.4 && grep -o "PLUGIN_VERSION = '[^']*'" package/dist/index.js
PLUGIN_VERSION = '0.1.5'

My colour PR set both to 0.1.5 consistently; the renumber down to 0.1.4 caught package.json and missed the constant. Entirely my kind of mistake to have set up, so: fixed, plus a guard.

Behaviourally harmless — plugin features are feature-detected through capabilities, never compared by version, so nothing breaks. That is exactly why it has now drifted twice and survived review both times (once a release behind, per the note in CLAUDE.md; now once ahead). Nothing fails, so nobody notices.

Hence a test rather than a third note asking the next person to remember:

expect(PLUGIN_VERSION).toBe(pkg.version)

It lives in src/ because that's where npm test looks (bun test src/), which does mean a CLI test reaching into tabby-plugin/. I think the trade is worth it for an invariant that's now failed twice, but it's the one part of this PR I'd understand you dropping — the alternative is a plugin-side test setup that doesn't exist yet.

cctabs config omitted defaults.color

It printed claude.flags, defaults.workspace and defaults.prefix, so the one command whose job is "show me what my config is" silently left out a setting it was honouring. Concretely, with color = "orange" set and working:

$ cctabs config
claude.flags       = [...]
defaults.workspace = (none)
defaults.prefix    = (none)

which reads as "the colour wasn't picked up" when in fact it resolves fine. My omission in the colour PR.

Testing

npm test — 226 pass, 0 fail. npm run typecheck and npm run build clean. The guard test deliberately uses fileURLToPath(new URL(...)) rather than Bun's import.meta.dir, so typecheck passes without depending on @types/bun resolving.

Verified on a live 53-tab fleet: CLI 0.5.1 from npm has both features, plugin 0.1.4 installed via cctabs install-tabby-plugin --no-restart (the --no-restart flag is genuinely useful here — restarting Tabby under 53 tabs is not a casual act), and [backends.enterprise] color = "blue" + [defaults] color = "orange" resolves to #0275d8 / #f0ad4e as intended.

🤖 Generated with Claude Code

…efaults.color

Two loose ends from the colour release.

`tabby-cctabs` 0.1.4 shipped with PLUGIN_VERSION = '0.1.5', so /api/health — and
therefore `cctabs doctor` — reported a version that was never published. The
renumber from 0.1.5 to 0.1.4 caught package.json but not the constant.

Behaviourally harmless, since plugin features are feature-detected through
`capabilities` rather than compared by version. That is exactly why this pair has
now drifted twice and both times survived review: nothing fails. So this adds a
test asserting the two agree, rather than a third note in CLAUDE.md asking the
next person to remember. It reads the plugin's files from `src/` because that is
where `npm test` looks; drop it if the coupling isn't worth it.

Separately, `cctabs config` printed claude.flags, defaults.workspace and
defaults.prefix but not defaults.color — so the one command whose job is "show me
my config" omitted a setting it was honouring, which reads as the colour not
having been picked up at all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploying cctabs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 60305b0
Status: ✅  Deploy successful!
Preview URL: https://7338e608.cctabs.pages.dev
Branch Preview URL: https://fix-plugin-version-drift.cctabs.pages.dev

View logs

motin and others added 2 commits August 26, 2026 10:39
… npm test

The guard test added in this PR asserts PLUGIN_VERSION matches
tabby-plugin/package.json, but it only runs under `npm test` — which
this workflow never invokes, and which the CLI's release workflow runs
on a separate, independently versioned tag. A plugin bump made without
touching the constant would therefore still publish before any test saw
it, which is precisely how the drift arrived both times.

The tag-vs-package.json step already has both values in hand, so it
checks the constant too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L96RQtEkx5rJEesxqCdNut
Colour was applied in the spawn/recreate path only. Whether a restored tab is
attached or recreated turns on whether its shell happens to be alive, and after a
terminal restart that comes down to which tabs got focused first — Tabby spawns a
recovered tab's shell only on focus. So a restored fleet came back
half-coloured, in an order nothing in the user's model predicts.

Found while planning a real 65-tab restart, where the split would have been
roughly 64 recreated (coloured) and 1 attached (not), varying with how much the
user clicked around before running restore.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@motin
motin merged commit c42b78d into main Aug 27, 2026
1 check passed
@motin
motin deleted the fix/plugin-version-drift branch August 27, 2026 20:11
motin added a commit that referenced this pull request Aug 27, 2026
The Release flow section still described `npm publish` with an Automation
token. Both packages moved to OIDC trusted publishing gated on the `release`
environment, so there is no token, and pushing a tag queues a publish rather
than performing one — which is the part worth knowing, since a tag whose run
is never approved looks released and isn't.

Also writes down the no-gaps rule: a version that was tagged but never
published gets its tag re-pointed, not abandoned. That is what happened to
v0.5.2, whose run sat waiting while #19 landed on top of it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L96RQtEkx5rJEesxqCdNut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant