fix(workspace-template): send auth_headers() on register - #222
Closed
airenostars wants to merge 1 commit into
Closed
fix(workspace-template): send auth_headers() on register#222airenostars wants to merge 1 commit into
airenostars wants to merge 1 commit into
Conversation
main.py posts to /registry/register without an Authorization header.
That works on first-ever boot (bootstrap path when no live tokens exist),
but every subsequent register — container restart, crash recovery,
redeploy — hits C18 hijack-prevention (requireWorkspaceToken) and 401s.
Symptom: workspace status stuck at 'provisioning' forever even though
the agent is healthy and heartbeats succeed (heartbeat.py already uses
auth_headers()).
Fix: import auth_headers in main.py and attach it to the register call.
On first boot the token file doesn't exist yet, so auth_headers()
returns {} — unchanged bootstrap behavior. On every restart thereafter
the on-disk token is attached and C18 passes.
Closes #215
4 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
workspace-template/main.pywas posting to/registry/registerwithout anAuthorizationheader. First-ever register works (bootstrap path), but every re-register (container restart, crash recovery, redeploy) hits C18 hijack-prevention and 401s.provisioningeven though the agent is healthy —heartbeat.pyalready usesauth_headers()so heartbeats succeed, but status never transitions back toonline.auth_headersinmain.pyand attach it to the register call. Unchanged bootstrap behavior (first boot returns{}), authenticated on every subsequent register.Closes #215
Test plan
provisioning.provisioning→online.python3 -c "import ast; ast.parse(open('workspace-template/main.py').read())"passes.python-lint+e2e-apishould pass unchanged (no route behavior changed, only client-side header addition).🤖 Generated with Claude Code