Skip to content

Token harness refresh#125

Open
mdeyell-valid-mind wants to merge 10 commits into
mainfrom
mdeyell/gh-104/token-harness-refresh
Open

Token harness refresh#125
mdeyell-valid-mind wants to merge 10 commits into
mainfrom
mdeyell/gh-104/token-harness-refresh

Conversation

@mdeyell-valid-mind

@mdeyell-valid-mind mdeyell-valid-mind commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Adds support to the agent harness integrations so short-lived OAuth access tokens can be refreshed automatically.

I tested this with PI.

When reviewing please look at the docs to make sure those are usable to you.

Changes

  • Added token command execution, expiry parsing, caching, and one-time 401 retry support:
  • Supports token command output as either:
    • a raw bearer token
    • JSON containing access_token, accessToken, or token
    • optional expiry fields via expires_in, expires_at, or expiresAt
  • Persists token caches for the Node integrations under each integration state directory.
  • Updates docs for auth-mode setup and short-lived token usage.

@mdeyell-valid-mind mdeyell-valid-mind marked this pull request as ready for review July 6, 2026 20:35
@mdeyell-valid-mind mdeyell-valid-mind force-pushed the mdeyell/gh-104/token-harness-refresh branch from 4ce6954 to 41826ab Compare July 9, 2026 16:23

@hunner hunner left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid, well-tested feature with unusually careful cache handling — the fresh-temp-file + atomic rename dance so 0600 actually applies, the sha256(command + URL) cache keying, the single-flight refresh promise, and the bounded one-shot 401 retry are all right. Enabling Pi in the integration harness so the full mint → cache → re-mint → 401-retry path is exercised end-to-end is great. Docs are accurate to the code (I verified the 55-minute default, skew, cache keying, mode, and retry semantics all match).

Approving with five issues and three nits inline — none blocking, but 1, 2, and 5 are small concrete fixes worth making before merge.

🤖 Automated reply

Comment thread scripts/fake_agent.py Outdated
Comment thread examples/shared-agent-hook/atryum-hook.mjs Outdated
Comment thread examples/amp-plugin/atryum.ts
Comment thread examples/pi-extension/index.ts
Comment thread integrations/lib/harness.sh Outdated
Comment thread examples/amp-plugin/atryum.ts Outdated
Comment thread examples/amp-plugin/atryum.ts Outdated
Comment thread examples/amp-plugin/atryum.ts
@mdeyell-valid-mind

Copy link
Copy Markdown
Contributor Author

@hunner Thanks, I updated this

@mdeyell-valid-mind mdeyell-valid-mind requested a review from hunner July 9, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants