Skip to content

Copy a trial's refreshed token back while the trial runs, not after #87

Closed

Description

@braboj

A trial that refreshes its OAuth token retires the refresh token it shares with the account's file. The harness copies the new token back only when the trial ends, so every other session on the machine holds a dead token until then.

What happened, 2026-10-30

15:05  hybrid-6 refreshes inside the trial -> scratch home expires 23:05
       (the CLI replaces the file, so the link to the account's file breaks)
15:10  the owner's session token expires; its refresh token is retired
       -> forced /login (account file now expires 23:10)
~16:00 hybrid-6 ends -> refresh_credentials keeps the later 23:10 login

Fix

  • While a trial runs, watch the scratch home's .credentials.json.
  • When its link breaks and it expires later, write it back over the account's file at once, through write_back under credential_lock.
  • Stop the watcher when the trial ends; refresh_credentials stays as the final pass.

Acceptance

  • A self-test check: a home refreshed mid-trial reaches the account's file before the trial ends
  • The existing rotation checks still pass
  • Prints no token
  • Restarting round 5c to pick it up is the owner's call

Related: #83 (OAuth stall), #84 (write-back at trial end), solid-ai-dev/solid-ai-dirigent#13 (continuous operation).

🤖 Generated with Claude Code

https://claude.ai/code/session_01DpT5xPB8YTAMW2Msp4aPTX

Activity

  1. added
    bug
    on Oct 30, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions