aft icon indicating copy to clipboard operation
aft copied to clipboard

gh shim (0.67.0+): agent GitHub writes refused on a daemon install without a routing manifest; github.shim:false needs a restart

Open iceteaSA opened this issue 1 week ago • 1 comments

Description

Since v0.67.0 (commit 9f9e7ba2c), the gh shim refuses every GitHub write from an agent shell on a daemon-mode install that has no signed routing manifest. The operator switch github.shim: false does not stop the refusal until the module restarts. The release notes of v0.67.0 and v0.67.1 do not mention the change. The code is the same in v0.68.0.

1. The guard counts AFT's own relay as offered routing

gh_shim/manifest_guard.rs:55-64 refuses the write when routing_may_be_offered is true. That is true when the daemon catalog shows the module aft serving gh_shim.bot_request (gh_shim_relay_client.rs:35). AFT itself is that relay, so each daemon install that never got a manifest refuses:

gh_shim_manifest_unavailable: GitHub writes are refused because this machine's signed routing manifest is missing or invalid

The guard also refuses GH_SHIM_BYPASS=operator (test manifest_unavailable.rs:362). Reads continue to work.

2. The guard path does not read the operator switch

The other shim paths check shim_disabled_by_operator() (gh_shim.rs:917, 936, 949, defined at :1466). The guard dispatch at gh_shim.rs:983-991 does not. github.shim is restart-class (config_live.rs:789), so github.shim: false takes effect only when a module restart removes the shim from PATH.

Effect that we saw: after an upgrade to v0.67.1, agent gh writes failed with exit 86 for about 5.5 hours. They worked again after we set github.shim: false and restarted the module.

Possible repair:

  • Let the guard obey github.shim: false (or shim_disabled_by_operator()) at once, with no restart.
  • Do not count AFT's own relay as offered bot routing on an install that never got a manifest.
  • Document the expected setting for installs that do not have the maintainer's manifest.

3. Side defect: the login-shell PATH cache keeps entries that no longer exist

effective_path.rs:79-90 sets the merged PATH in the process (std::env::set_var("PATH", path)) and then starts the refresh helper, which inherits that PATH. The login-shell probe (:370-384) therefore starts from the cached value. Folders that no longer exist, for example deleted task startup-image/shims folders, stay in the result, and the helper writes them back to effective-path.json (:333-336). We saw four such folders in the cache after the restart above.

Possible repair: start the probe from the PATH that the process inherited, not the merged one. Remove entries that do not exist before the helper writes the cache.

Environment

  • AFT v0.67.1 (seen), v0.68.0 (same code), Linux, daemon mode, no routing manifest.

iceteaSA avatar Nov 26 '26 15:11 iceteaSA

Thanks, and your reading is right on both counts. This is a regression on our side.

  1. The guard treats AFT's own write relay, which every daemon install serves, as proof that the machine's GitHub writes are governed. So an install that never received a routing manifest refuses every agent write.
  2. That refusal path doesn't check github.shim: false, so the switch only works after a module restart.

The change also should have been in the 0.67.0 release notes, and it wasn't.

We'll fix both. The guard will refuse writes only on a machine that has held a signed routing manifest before, and github.shim: false will take effect at once, with no restart. We'll also fix the PATH cache keeping folders that no longer exist: the probe will start from the inherited PATH, and missing folders will be dropped before the cache is written.

Until the fix ships, the workaround you found (github.shim: false plus a module restart) is the right one. Thanks for the precise trace.

aft-alfonso[bot] avatar Nov 26 '26 16:11 aft-alfonso[bot]