Skip to content

fix(patchy): dev says when it joined a running session - #680

Merged
allisonmahmood merged 1 commit into
mainfrom
fix/584-dev-join-notice
Oct 15, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
fix/584-dev-join-notice

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

A second patchy dev while a session is running returned the session with output identical to a fresh start, so an agent couldn't tell that nothing was pulled from Patchy. After patchy look restore 1, the repo stayed on revision 2 with no notice.

Fix

dev already knew whether it started a session or joined one; this surfaces it. report in devLifecycle.ts takes the start outcome:

  • patchy dev --json gains joined: boolean: true when it returned the running session, false when this invocation started one.
  • On a join, text mode adds one line: "Joined the running session; nothing was pulled from Patchy. To bring in look or description changes, run pnpm patchy refresh; config and fixture changes need pnpm patchy dev stop, then pnpm patchy dev." It isn't a warnings entry, since joining is routine.
  • patchy dev status keeps its shape and has no joined key.
  • A join is still key-free, offline and makes no request. Nothing new is fetched or synced; refresh already works beside a running session.

Tests

In devLifecycle.test.ts:

  • The idempotence case asserts joined: false and then joined: true with exact equality, and status deep-equals the session without joined.
  • The join case runs with no key and makes no request, and still reports the saved release and identity.
  • The foreground case checks the text join line appears on a join and not on a fresh start.
  • A new case: with a session serving a page that links look.css, refresh exits 0 with the "rev 1 → 2" notice and the served page switches to the new look with the same pid.

The packed-CLI e2e's exact dev --json key list includes joined.

Tested by hand

pnpm dev up brightline, two look revisions published (rev 1 finance #c20029, rev 2 linear #5e6ad2), the starter's look.css import added to the kudos repo's src/main.tsx, all through the environment's CLI:

$ pnpm patchy dev
Brightline Studio's look changed, none → rev 2 by Allison Mahmood: linear violet. Colours and fonts follow; to restyle this tool's components, ask your agent to update it to the current look.
http://127.0.0.1:42695/dev/03gg6resj7fu
Colleague: http://127.0.0.1:46347/dev/03gg6resj7fu
Log: <workspace>/kudos/.patchy/dev/d158ec14dfd12be4/dev.log
Stop: pnpm patchy dev stop --api-url 'http://<env>.localhost:35154'

$ pnpm patchy dev --json
{ "ok": true, "healthy": true, "joined": true, "url": "http://127.0.0.1:42695/dev/03gg6resj7fu", "colleagueUrl": "…", "logPath": "…", "stop": "…", "pid": 1790307, "release": "0.11.0", "identity": { … }, "warnings": [] }

$ patchy look restore 1 --json        → current 1
$ pnpm patchy dev
Joined the running session; nothing was pulled from Patchy. To bring in look or description changes, run `patchy refresh`; config and fixture changes need `patchy dev stop`, then `patchy dev`.
http://127.0.0.1:42695/dev/03gg6resj7fu
Colleague: http://127.0.0.1:46347/dev/03gg6resj7fu
Log: <workspace>/kudos/.patchy/dev/d158ec14dfd12be4/dev.log
Stop: pnpm patchy dev stop --api-url 'http://<env>.localhost:35154'
  (index.json still names rev 2)

$ PATCHY_STATE_DIR=<empty> pnpm patchy dev --json
{"joined":true,"pid":1790307,"release":"0.11.0","user":"[email protected]","warnings":[]}
  (the same empty state dir makes `refresh` refuse: "No publishing key is stored for …")

$ pnpm patchy dev status --json   → keys: colleagueUrl, healthy, identity, logPath, ok, pid, release, stop, url, warnings

$ pnpm patchy refresh
Brightline Studio's look changed, rev 2 → 1 by Allison Mahmood: finance green. Colours and fonts follow; …
Refreshed 0.11.0 → 0.11.0.
  (served page's --look-accent went #5e6ad2 → #c20029 within 2s; status pid still 1790307)

$ pnpm patchy dev stop --json && pnpm patchy dev --json
{"joined":false,"pid":1805257,"warnings":[]}

This ran before review added the pnpm prefix to the join line's commands, so the join line above is that build's wording. The foreground lifecycle test asserts the final wording from the bundled CLI.

pnpm verify ran in full on the pre-review commit while ~20 other lanes loaded the machine: 1732 tests passed. 10 timed out, across unrelated packages (Fleet, Postgres parity, csv, PGlite) and two in devLifecycle.test.ts. That file passes 10/10 on its own, and the packed CLI and tier 2 e2e passed.

Surfaces

  • Wire contract / CLI: the dev --json shape changed. Updated packages/patchy/README.md (dev section, the JSON table split into dev and dev status rows, company-look section) and ADR-0004 (local-runtime paragraph and dev JSON table). No new command, flag or exit code; commands.ts is untouched.
  • Skills: global patchy skill's look paragraph, with its skills-lock.json hash refreshed. Project skills patchy-loop (what joined: true means, and to refresh when the person wants cloud changes, not on every join) and patchy-look, plus the generated no-look text in Generation.ts.
  • Product shape: docs/product.md and docs/SKILL_DISTRIBUTION.md now say "a new dev start", and that a running session takes changes with refresh.
  • Not applicable: no API package route, migration, served page, dev runner or package layout change.

Closes #584

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

@github-actions github-actions Bot added area:server Touches the server area area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area size:m 100-500 changed lines labels Oct 15, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review: GPT 6.1 Sol (xhigh, codex exec, read-only) on git diff origin/main...HEAD

Sol reported no correctness findings for the start/join path, the single-document JSON, --foreground or dev status. It reported no scope creep and no test-quality or flakiness findings, and confirmed every mirrored surface plus the skills-lock.json hash. It found two Low issues, both fixed in this commit:

  1. Low, packages/patchy/src/devLifecycle.ts: the join line suggested bare patchy commands, but a repo uses its pinned pnpm patchy. Fixed: refresh, stop and start in the line are now pnpm patchy …, matching the Stop: line, and the foreground test asserts the new text.
  2. Low, docs/product.md runtime paragraph: it said plain "patchy dev checks the pin… then authenticates", which blurs start and join. Fixed: it now says "a new patchy dev session", and that a second patchy dev joins the running session and fetches nothing.

Both fixes are wording only, so I didn't run a second Sol round.

A second `patchy dev` returned the running session with output identical to a
fresh start, so an agent could not tell that nothing was pulled from Patchy.
`dev --json` now reports `joined`, and text mode adds one line on a join
pointing at `patchy refresh` for look and description changes. `dev status`
keeps its shape.

Closes #584

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood force-pushed the fix/584-dev-join-notice branch from 2f6d33e to 08aa7b2 Compare October 15, 2026 16:47
@allisonmahmood
allisonmahmood merged commit d58fed9 into main Oct 15, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the fix/584-dev-join-notice branch October 15, 2026 16:58
allisonmahmood added a commit that referenced this pull request Oct 16, 2026
…u when they fail (#720)

Release 13's What's new entry, written from `c9b8fc4`, ahead of
deploying it. `patchy` and `CURRENT_RELEASE` move to `0.13.0`, so CLIs
and patch repos installed before this deploy are told to upgrade.

| Change | PRs |
| --- | --- |
| New: Home puts the patches you use first | #713, #716, #719 |
| New: Every patch in one list | #715 |
| Improved: Each patch's page leads with Open | #717 |
| New: See when your tools are failing | #718 |
| Fixed: Everyone has a name | #687 |
| Improved: Your company's look is easier to get right | #697, #696,
#703, #688 |
| Improved: Forms follow your look's error states | #691, #692 |
| Improved: Clearer answers when a publish goes wrong | #686, #685, #689
|
| Fixed: Your agent's Patchy commands are steadier | #695, #704, #680,
#681 |
| Behind the scenes: stricter checks on static pages and tools' database
requests; malformed requests are logged | #682, #693, #683 |
| Behind the scenes: usage numbers count every publish, sharing change
and restore | #698, #699, #700, #690 |
| Test and tooling only, no line | #705, #702, #701, #694, #684, #607 |

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area area:server Touches the server area size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(patchy): patchy dev doesn't say when it joined a running session

1 participant