Skip to content

fix(patchy): login gives the code's deadline as minutes left, not a UTC timestamp - #675

Merged
allisonmahmood merged 1 commit into
mainfrom
fix/671-login-expiry-minutes
Oct 14, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
fix/671-login-expiry-minutes

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

What changed

During a real setup an agent told the person "the code works until 12:29 UTC" while their clock read 14:20. Onboarding step 2 had agents relay the raw expiresAt instant, and text-mode patchy login printed that same ISO string on its Expires: line to a person at a terminal. A login code lasts ten minutes, so the useful thing to say is how long is left.

  • Text-mode patchy login now prints Expires in about 10 minutes, at 14:29 (or Expired at 14:29 for a code that already ran out locally). Minutes left come from Effect's Clock; the clock time comes from DateTime.CurrentTimeZone, which the CLI entrypoint provides as the machine's zone (DateTime.layerCurrentZoneLocal). The time is a locale-independent HH:MM. An unparseable stored expiresAt falls back to the old raw line instead of failing the login.
  • --json and stored state are unchanged: expiresAt stays the canonical ISO instant.
  • references/onboarding.md step 2: the pending line now says "the same link and code work for about <n> more minutes". A code lasts ten minutes, <n> is counted down from the current time to the returned expiresAt (fixed across polls), and any clock time names its zone, since the agent's machine may not share the person's.

SKILL.md never relays the expiry, so the global skill and skills-lock.json are untouched. packages/patchy/README.md and ADR-0004 only show expiresAt in the JSON tables, which did not change, so neither needed an edit.

Closes #671

How it was verified

  • New focused test in packages/patchy/src/Login.test.ts: a text-mode handoff under TestClock and a fixed Asia/Kolkata zone, checking the whole printed handoff at 10 minutes left, 1 minute left, and past expiry. It passes whatever the machine's TZ and locale are (also run with TZ=America/Los_Angeles LANG=de_DE.UTF-8).

  • Ran the built CLI against a stub instance with TZ=America/New_York and TZ=Europe/Berlin. Each printed minutes left with that zone's clock time, and --json still returned the ISO expiresAt.

  • pnpm verify on the rebased branch: format, lint, typecheck, synth, postgres-concurrency, cli-smoke, tier2-smoke and browser passed. The offline test step was hit by load on the shared machine: a CLI child killed by signal in an unrelated retire test and a SIGKILLed vitest worker. Rerun alone, pnpm test passed with 177 files and 1737 tests.

  • pnpm test passes locally

  • Added or updated tests covering this change

Surface walk (CLAUDE.md › Hit every surface)

  • Wire contract: does not apply. No request, response or --json shape changed.
  • CLI: applies. Only the text-mode handoff line of patchy login changed. Flags, exit codes and JSON are unchanged. README and ADR-0004 do not show that line. The global skill's SKILL.md does not mention the expiry. The onboarding reference was updated, and a reference-only edit needs no lock refresh.
  • Dev loop, vocabulary/product shape, migrations, company resources, served pages, reverse states, repo layout: do not apply.

Release impact

  • Breaking — requires action from anyone already running this
  • Not breaking — no action required

Only the text-mode wording of one line changed. The --json contract agents use and the stored login state are the same.

Made by Claude Opus 5.5 via Claude Code in T3 Code

…TC timestamp

Text-mode `patchy login` printed the raw ISO expiry; it now says how many
minutes are left and the local clock time, from Effect's Clock and the
current time zone. The onboarding reference tells agents to count the
minutes down from `expiresAt` and to name a zone with any clock time.
`--json` and the stored login keep the ISO instant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood force-pushed the fix/671-login-expiry-minutes branch from 5376a5e to d2c1843 Compare October 14, 2026 13:38
@github-actions github-actions Bot added area:cli Touches the cli area area:docs Touches the docs area 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 at d2c1843.

  • Correctness: expiry calculation and local-time conversion match fix(patchy): login gives the code's deadline as minutes left, not a UTC timestamp #671. Polling, persistence and server-authoritative expiry handling remain intact; no Windows-specific dependency was introduced.
  • Completeness: no stale mirrors found in README, ADR-0004, skills, /llms.txt, browser tests or packed e2e scripts.
  • Standards: Clock, DateTime and entrypoint layer wiring follow the Effect spec. No rendered HTML changes; UI consistency does not apply.
  • Tests: fixed TestClock and Asia/Kolkata make expectations independent of host zone and locale. The test would fail against the original ISO output. Tests were not rerun during this read-only review.
  • Public hygiene: diff and PR body contain no personal paths, emails or identifying data.

All five judgment calls are acceptable:

  1. Unlabelled CLI zone: matches the requested machine-local clock time. A remote UTC shell can differ from the person’s clock, but minutes lead; naming the zone would be optional polish.
  2. Rounded minutes, minimum 1: consistent with “about.” Showing 11 under clock skew follows the fixed returned deadline; clamping to 10 would misrepresent that calculation.
  3. Malformed expiry fallback: preserves login functionality without changing stored state or overriding the server.
  4. No prescribed agent command: the instruction explicitly requires recalculating against the fixed expiresAt; platform-specific machinery is unnecessary.
  5. Unchanged SKILL.md, lock, README and ADR: correct. The text line is absent from those mirrors, SKILL.md delegates handoff wording to onboarding, and the lock hashes SKILL.md alone.

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

@allisonmahmood
allisonmahmood merged commit 4596fa0 into main Oct 14, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the fix/671-login-expiry-minutes branch October 14, 2026 13:48
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:cli Touches the cli area area:docs Touches the docs area size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(patchy): login gives the code's deadline as minutes left, not a UTC timestamp

1 participant