()
| 72 | // When the parent process refreshes the token (via token file or env var), |
| 73 | // the transport can pick it up on reconnection. |
| 74 | const refreshHeaders = (): Record<string, string> => { |
| 75 | const h: Record<string, string> = {} |
| 76 | const freshToken = getSessionIngressAuthToken() |
| 77 | if (freshToken) { |
| 78 | h['Authorization'] = `Bearer ${freshToken}` |
| 79 | } |
| 80 | const freshErVersion = process.env.CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION |
| 81 | if (freshErVersion) { |
| 82 | h['x-environment-runner-version'] = freshErVersion |
| 83 | } |
| 84 | return h |
| 85 | } |
| 86 | |
| 87 | // Get appropriate transport based on URL protocol |
| 88 | this.transport = getTransportForUrl( |
no test coverage detected