Commit 88f1fc8
fix(control-plane): iterate projects to refresh running session tokens (#1206)
## Summary
- `refreshAllRunningTokens` called `factory.ForProject(ctx, "")` which
the SDK rejects with `"project is required"`
- The refresh loop was silently failing every 10 minutes, leaving runner
pod BOT_TOKEN files stale
- BOT_TOKEN expiry caused `UNAUTHENTICATED` errors on the gRPC stream —
runner unable to push session messages
- Fix: list all projects first (using a sentinel project client for the
`/projects` endpoint which ignores the project header), then list
running sessions per project and refresh each token
## Test plan
- [ ] Deploy updated control-plane
- [ ] Start a session, wait 10+ minutes
- [ ] Verify control-plane logs show token refresh success (no "project
is required" warn)
- [ ] Verify runner pod continues streaming without UNAUTHENTICATED
errors after 15 minutes
🤖 Generated with [Claude Code](https://claude.ai/code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Improvements**
* Token refresh operations now reliably support multi-project
environments with enhanced error handling that prevents single-project
failures from disrupting the entire refresh process.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Ambient Code Bot <bot@ambient-code.local>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 94b0433 commit 88f1fc8
1 file changed
Lines changed: 34 additions & 16 deletions
Lines changed: 34 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
918 | 918 | | |
919 | 919 | | |
920 | 920 | | |
921 | | - | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | | - | |
927 | | - | |
| 921 | + | |
928 | 922 | | |
929 | | - | |
| 923 | + | |
930 | 924 | | |
931 | | - | |
| 925 | + | |
932 | 926 | | |
933 | 927 | | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | | - | |
938 | | - | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
939 | 957 | | |
940 | 958 | | |
941 | | - | |
| 959 | + | |
942 | 960 | | |
943 | 961 | | |
944 | | - | |
| 962 | + | |
945 | 963 | | |
946 | 964 | | |
0 commit comments