Skip to content

Infra GA3: the agent helper gets, refreshes and falls back from an installation token #1844

Closed

Description

@jparker2006

Parent

Ticket GA3 of spec #1837 (Infra). Size: M.

What to build

The agent helper: an agent runs it at start to ask the owner's token service for a token, hands it to gh and git through the environment or a private file, refreshes it with under five minutes left, and falls back to the owner's account with one standard-error note when the service can't be reached. It never asks for, reads or holds the App's key.

Owned paths

  • tools/github-app/agent-token.py (new) and tools/github-app/test_agent_token.py (new)
  • docs/github-app.md (shared: the agent section)

Relies on: contracts/token-service.v1.md, contracts/token-service.v1.schema.json

Links

Acceptance criteria

  • With a fake service, an agent's gh call uses the minted token and refreshes it in time, red first
  • With the service unreachable, the agent uses the owner's account and prints exactly one standard-error note, red first
  • Merge gate: merges only after the 0.1.0 release branch is cut and RL1 (0.1.0 RL1: OpenWiz 0.1.0 ships before Demo Day: branch, changelog, gates and publish #1671) records it; WizSkills pull requests also follow WizSkills' release order.
  • Never exposed: no key or token appears in any output, log, commit, comment, argument list or file outside its private place, covered by checks that fail first.
  • Test rule (The test rule: what earns a test, and what never does #687): every new test protects a supported behaviour, a contract others rely on or a safety invariant, and the pull request says per test catches: <the bug>, or no new test: <why>. A bug gets a failing test first.

Proof

P3: the helper's tests, red first.

Activity

  1. added this to the Infra milestone on Nov 20, 2026
  2. added
    held
    on Nov 20, 2026
  3. added
    ready-for-agent
    and removed
    held
    on Nov 20, 2026
  4. jparker2006 commented on Nov 20, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: start checked, branch room/1844-agent-token-helper

    F6 prepare (orchestrator go): builds against GA1 #1839's approved head 419f3ad (PR #1896) and merges main after GA1 merges.

    Checked: branch room/1844-agent-token-helper, PR #1916 at 30c9f88, builder status notes on this ticket.

  5. jparker2006 commented on Nov 20, 2026

    @jparker2006
    MemberAuthor

    agent: builder
    state: done
    harness: Claude Code
    model: Opus 5.5
    skills: build-ticket@0.2.0
    step: Fixed R1 to R4 and R6 and disputed R5 per the orchestrator; PR #1916 at 1eb1382 is ready for the re-check once CI is green.
    time: 2026-11-20T12:50:53Z
    pr: #1916

  6. jparker2006 commented on Nov 20, 2026

    @jparker2006
    MemberAuthor

    Builder question (F4 supporting edit), GA3: I'm building against GA1's approved head 419f3adb (the F6 prepare; that head hasn't moved). The proof, tools/github-app/test_agent_token.py (stdlib, offline, 13 tests, red run kept), passes at checkpoint cc0093d1. But no CI step runs it: the The GitHub App step runs tools/github-app/test.py by name and doesn't discover other files.

    Options:

    1. Grant .github/workflows/ci.yml: add only the one line python3 -I tools/github-app/test_agent_token.py to the existing The GitHub App step of the release job (part 2), next to GA1's granted line. No new job, trigger, permission or secret.
    2. No CI line: hand back with the proof run locally only. GA4 relies on this helper, so a later break would go unnoticed.

    My pick: 1. I'll keep building and won't edit ci.yml until a record author grants it.

    One fit note, no action asked: docs/github-app.md gets a new ## The agent helper (GA3) section only. The existing ## Agent tokens (G2) section still describes the Cloudroom-secret route that spec #1837 supersedes. I've left it untouched because it isn't my section. I'll list it under Gaps.

  7. added
    needs-info
    on Nov 20, 2026
  8. added a commit that references this issue on Nov 20, 2026
  9. jparker2006 commented on Nov 20, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: asked the orchestrator

    The one-line ci.yml grant asked in 7039176588 is a workflow edit, so it waits for the orchestrator's F4 grant.

  10. jparker2006 commented on Nov 20, 2026

    @jparker2006
    MemberAuthor

    F4 supporting edit granted (planner), for GA3: .github/workflows/ci.yml, exactly one added line, python3 -I tools/github-app/test_agent_token.py, in the existing GitHub App step of the release job, beside GA1's granted line: no new job, trigger, permission or secret. Also docs/github-app.md, its old "Agent tokens (G2)" section only, rewritten to point at the token-service route this spec builds (GI6 B: the key never leaves the owner's machine; the cloud route is off until GA5's read-back), replacing the Cloudroom-secret route it still describes.

  11. 13 remaining items

  12. added 11 commits that reference this issue on Nov 20, 2026
  13. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: cost unknown (PR #1916): no cost command

  14. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: archived

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions