Commit 775a0f1
committed
fix(agent): honor the logout sentinel in every token consumer
Address review findings on the emptied-env-file logout:
- list_repos built its gh env with a truthiness check, so an empty (logged-out)
token fell back to the raw process env and could enumerate the previous
actor's private repos. Clear both token vars on a managed logout; only an
undefined (unmanaged) token inherits the process env.
- fetchGhLogin memoized the login across actor transitions, so after a rebind
attribution used the previous actor's login. Key the cache on the live token.
- readGithubTokenFromSandboxEnvFile treated every read error as an unmanaged
sandbox; a present-but-unreadable file during a transition then resurrected
the frozen process token. Only ENOENT falls back; other errors fail closed.1 parent b1f0509 commit 775a0f1
4 files changed
Lines changed: 44 additions & 7 deletions
File tree
- packages/agent/src
- adapters/local-tools/tools
- server
- utils
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
63 | 71 | | |
64 | | - | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3824 | 3824 | | |
3825 | 3825 | | |
3826 | 3826 | | |
| 3827 | + | |
3827 | 3828 | | |
3828 | 3829 | | |
3829 | | - | |
| 3830 | + | |
| 3831 | + | |
| 3832 | + | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + | |
| 3836 | + | |
| 3837 | + | |
| 3838 | + | |
3830 | 3839 | | |
3831 | 3840 | | |
3832 | | - | |
| 3841 | + | |
3833 | 3842 | | |
3834 | 3843 | | |
3835 | 3844 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
97 | 104 | | |
98 | 105 | | |
99 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
100 | 115 | | |
101 | 116 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
0 commit comments