Skip to content

Session keepalive: watch check touches the session, auth refresh #12

Closed

Description

@Microck

What to build

A user who logs in once stays logged in for as long as they keep using the CLI, including when the only thing running is the scheduled watch timer. Wallapop's session route re-issues the session cookie with a fresh 30-day expiry on every mint (verified 2026-09-14: expiry moved from 14 Oct 10:32 to 14 Oct 21:09 after one mint), and the CLI already persists the rotated cookie. The gap is that search, item and seller Watches are public, so a scheduled watch check never mints and the Session silently expires after 30 days.

Two behaviours:

  1. watch check touches the active Profile's Session once per run when one exists (mint, persist rotation), so watch service keeps the login alive as a side effect. A failed keepalive is reported on stderr with exit 3 only if the run needed auth; otherwise it is a warning, since the Watches themselves still work.
  2. auth refresh mints once and reports the new cookie expiry, for people who schedule with cron instead of the service.

Acceptance criteria

  • watch check with only public Watches and a valid Session performs exactly one mint and persists the rotated cookie; with no Session it performs none
  • auth refresh prints the profile, account and new session expiry (from the Set-Cookie Expires), in every output format; exit 3 when the Session is rejected
  • auth status shows the stored cookie's expiry, so a user can see how long they have
  • The interface contract and the embedded skills doc explain the sliding window and that running any authenticated command every 30 days keeps the login alive
  • Tests through the fake server assert the mint count for both cases

Further notes

Unknown: whether Wallapop's Keycloak realm caps the SSO session absolutely (the session survived past Keycloak's 10-hour default, and the realm advertises offline_access). Only observation over weeks will tell; a daily auth refresh in a scheduler on one machine is enough to find out. If a cap exists, the fix is a re-login, not anything this ticket can do.

Blocked by

  • None (can start immediately)

Activity

  1. added
    ready-for-agent
    on Sep 14, 2026
  2. added a commit that references this issue on Sep 14, 2026
    c0b9b3b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions