Skip to content

fix(auth): the signed-out front page tells an agent where to start - #674

Merged
allisonmahmood merged 1 commit into
mainfrom
fix/669-door-setup-line
Oct 14, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
fix/669-door-setup-line

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

What changed

An agent given only the instance's address fetches / and gets the signed-out door, a 401 page that never mentioned /llms.txt. On a real setup on 2026-10-14 the agent found /llms.txt only by guessing the convention.

The door for / (query strings included) now carries one supporting-text line, for anyone setting Patchy up through an agent:

Setting up with an agent? Tell it: Set up Patchy using https://<instance>/llms.txt

door in packages/auth/src/RequireSession.ts builds it from the session's public base URL, escaped, without depending on Portal. It shows when the door's return path is /, and not on the failed sign-in variant. Patch and company doors are unchanged. It is plain text, not a link, so the door keeps its two actions (Sign in, Join the waitlist). The line sits before the actions, so no new CSS was needed.

Two decisions worth checking:

  • Both variants get the line. With Clerk it sits under the invitation note. With dev personas (local dev only, no waitlist) it sits under "Continue to your company.", so local dev shows what production shows.
  • The rule keys on the door's return path, not the request path. /login?return=/ therefore renders the same door as /, which keeps the existing invariant that the door and /login share one renderer. Plain /login returns to /machines and stays without the line.

Closes #669

Screenshots: the production (Clerk + waitlist) look at desktop and phone width, and the local dev door: https://post.patchyhq.com/d/g0ile2a6sx0f (public but unlisted; local dev data only).

How it was verified

  • pnpm test passes locally (pnpm check: format, lint, typecheck, synth, 177 files / 1737 tests)
  • pnpm verify: format, lint, typecheck, synth, postgres-concurrency, cli-smoke, tier2-smoke and browser passed. The test suite timed out in unrelated packages (packages/patchy CLI repo tests, SDK, PGlite) with a vitest worker SIGKILL while other worktrees ran heavy suites. Rerun alone, it passed: 177 files, 1737 tests.
  • Added or updated tests covering this change: one test in AuthPages.test.ts checks that the door for / and /?all=1 carries the setup line, and that a patch path's door and the failed sign-in door do not.

On a local instance (pnpm dev), signed-out curl of /?all=1 returned 401 with the line and http://127.0.0.1:<port>/llms.txt in it, and /company returned the door without it. pnpm dev shot of /login?return=/, plus the Clerk variant rendered through the real door with a stand-in session, are on the screenshots page.

The line only helps agents that read the 401 body (a shell curl). A fetch tool that discards error bodies still won't see it. Changing / to a 200 is out of scope, as the issue says.

CLAUDE.md surface walk

  • Served pages: applies. Followed the ui-consistency spec: it composes supporting-text and the shell's base code, with no new classes or CSS. The spec's page-kinds line now says the signed-out root's supporting-text gives the setup line, as plain text and not a third action. No policy fixtures change (no accepted/rejected HTML).
  • Vocabulary and product shape: docs/product.md's portal paragraph ("Signed out, / shows the login door") now mentions the line. No glossary term or ADR changes.
  • Wire contract, CLI, dev loop, migrations, company resources, reverse states, repo layout: do not apply. No API, command, runner, schema or package changes.

Release impact

  • Breaking: requires action from anyone already running this
  • Not breaking: one added line of copy on the signed-out front page

Made by Claude Opus 5.5 via Claude Code in T3 Code

An agent given only the instance's address fetches `/` and gets the
signed-out door, which never mentioned `/llms.txt`. The door for `/`
(query strings included) now carries one plain supporting-text line:
"Setting up with an agent? Tell it: Set up Patchy using <instance>/llms.txt",
built from the session's public base URL. Patch, company and failed
sign-in doors are unchanged, and the door keeps its two actions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added area:server Touches the server area area:docs Touches the docs area area:ui Portal and first-party browser pages, shared rendering and styles size:s Under 100 changed lines labels Oct 14, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

GPT 6.1 Sol review (xhigh), round 1

No blocker, should-fix, or nit findings in d14df6c.

  • Correctness: Root requests, including query strings, get the escaped configured instance URL. Patch, company, and failed sign-in doors remain unchanged. No Windows, idempotence, or crash-safety concerns arise from this rendering-only change.
  • Completeness: Product docs and the UI spec are updated. README, ADR-0004, API docs, skills, llms.txt, and e2e scripts need no changes because their contracts are unchanged. The global skill hash matches. Remaining “Hit every surface” entries do not apply.
  • Standards: No Effect, UI consistency, simplicity, or inaccurate-comment findings.
  • Tests: The focused test would fail on the original bug and checks query-bearing root, patch exclusion, and failure exclusion. Existing tests guard the 401 response and action count. Tests were inspected, not run.
  • Public hygiene: No personal paths, emails, or identifying machine data in the diff or PR body.

All four flagged decisions are acceptable:

  1. Return-path gating preserves the shared renderer: /login?return=/ gets the line; plain /login does not.
  2. <code> remains noninteractive text and inherits wrapping from .auth-card; it adds no action.
  3. Both Clerk and local-dev variants include the line.
  4. The product and UI-spec updates accurately describe the behavior.

The screenshot link was inaccessible; visual judgment rests on the markup and shared CSS.

NOT READY — code review is clean, but CI is still running on the latest commit.

@allisonmahmood
allisonmahmood merged commit 8478312 into main Oct 14, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the fix/669-door-setup-line branch October 14, 2026 13:35
allisonmahmood added a commit that referenced this pull request Oct 14, 2026
… Patchy is smoother (#679)

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

| Change | PRs |
| --- | --- |
| Fixed: Links within a page jump to their section | #677 |
| Improved: Set up Patchy however you ask | #672, #674 |
| Improved: Claude Code can know Patchy is your company's own | #676 |
| Fixed: Your agent remembers Patchy after a Node.js update | #673 |
| Fixed: Sign-in codes say how many minutes they have left | #675 |
| Behind the scenes: uploaded pages and logos are checked within strict
limits | #678 |

Made by Claude Opus 5.5 via Claude Code 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:docs Touches the docs area area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(auth): the signed-out front page tells an agent where to start

1 participant