GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(fleet): parse the personal token on the cache-daemon path too by dezren39 · Pull Request #12500 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

What broke

Every fleet gh write failed client-side while reads looked fine:

Post "https://api.github.com/...": net/http: invalid header field value for "Authorization"

Root cause

The cache daemon's personal op returns the resolved secret itself — the whole github-cli.hosts-yml file — in the response's token field. That is by design: the daemon is a dumb secret cache for this op and never learns which secret "personal" means (the request carries the secret name for exactly this reason).

FleetTokenProvider::token_for broke the contract: when a daemon answered it returned response_token() directly as the token, and only the in-process fallback closure ran parse_hosts_yml_token. So with the (now always-on) local daemon up, gh received the 183-char multi-line hosts.yml as GH_TOKEN and refused it as an Authorization header value.

Reads masked it completely: a read fails over to an App installation token on any failure, so attempt 1 (personal) died and attempt 2 succeeded. Writes repeat only on pre-execution refusals (the #8887 retry-safety contract), and a client-side header error is not one — so every write surfaced the failure. FLEET_GH_RAW=1 worked because it injects no token at all.

Shape evidence (lengths/classes only, never values): injected GH_TOKEN via the daemon was 183 chars containing newlines and colons (a YAML file); via --no-cache it was the clean 40-char gho_ token. Bisected with a stub FLEET_GH_BIN reporting the injected token's shape, plus FLEET_GH_BIN=/usr/bin/gh runs ruling the PATH shim in/out.

Fix

  • gh.rs: resolve the hosts.yml secret through via() (daemon or in-process), then parse the oauth_token out of whichever copy answered — one convergence point, personal_token().
  • gh_cache.rs: document the wire-contract asymmetry at request() so the next reader does not reintroduce it.
  • Regression test personal_token_is_the_parsed_token_not_the_secret: the value reaching GH_TOKEN is the parsed, header-safe token, never the multi-line secret; a secret without oauth_token errors by name.

Verification

  • cargo test -p fleet (1.99 toolchain): 70 unit + 9 integration tests pass, including the new regression test and all pre-existing gh::/gh_cache:: tests.
  • End-to-end with a locally built binary against the live local daemon, normal (non-raw) path, FLEET_GH_BIN pinned to the pristine gh exactly as the PATH shim pins it: POST /repos/developing-today/code/issues/12492/reactions succeeds on attempt 1 under personal (before: the header error above); reads still ~1.6s.
  • Note: the installed ~/tools/fleet keeps the defect until a build from this branch (or main after merge) is deployed; until then FLEET_GH_RAW=1 remains the workaround for writes.

Related documentation: doc/agents/gh-cache-daemon.md gained a section on this break (the personal contract, the shape-based diagnostic, and the direct-invocation shim-nesting wart with the same symptom family).


Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@dezren39
fix(fleet): parse the personal token on the cache-daemon path too
44f837c
The gh cache daemon's personal op returns the resolved hosts.yml secret itself (it is a dumb secret cache for that op), but FleetTokenProvider used the daemon response as a finished token and only parsed the in-process copy. Whenever a daemon answered, gh got the whole 183-char hosts.yml as GH_TOKEN and refused it client-side: net/http: invalid header field value for "Authorization". Reads masked it (they fail over on any failure); writes surfaced it, since they repeat only on pre-execution refusals.

Resolve the secret through via() on both paths and parse the oauth_token out of whichever copy answered, in one place (personal_token()). Document the wire-contract asymmetry in gh_cache.rs and add the regression test personal_token_is_the_parsed_token_not_the_secret.
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 10:38
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 71029d9f-d258-450a-a346-cd0fbb2ef3a4
Commits

Reviewing files that changed from the base of the PR and between d4a004a and 44f837c.

Files selected for processing: 2

  • pkgs/fleet/crates/fleet/src/gh.rs
  • pkgs/fleet/crates/fleet/src/gh_cache.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T10:40:11.888501Z 44f837c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit 7bfcaff into main Nov 22, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the xaltha/fleet-gh-personal-daemon-fix branch November 22, 2026 11:39
This was referenced Nov 22, 2026
docs(agents): document the fleet gh cache daemon and the write-path defect #12545
Merged
fix(queue): broker never re-serves condition parks or completed work (#13091) #13143
Merged
fleet: repo-queue dispatch fails with TLS UnknownIssuer behind the egress proxy (Rust TLS ignores SSL_CERT_FILE) #13185
Closed
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 24, 2026
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.