Skip to content

Conversation

@jakubno
Copy link
Member

@jakubno jakubno commented Aug 21, 2025

No description provided.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing Headers in Execution Request

In the post_execute handler, the request parameter is an ExecutionRequest Pydantic model (the JSON body). The code tries to access request.headers to get an access token. Since ExecutionRequest has no headers attribute, this raises an AttributeError, breaking every /execute call and preventing code execution.

template/server/main.py#L99-L115

if context_id:
ws = websockets.get(context_id, None)
else:
ws = websockets["default"]
if not ws:
return PlainTextResponse(
f"Context {request.context_id} not found",
status_code=404,
)
# set global env vars if not set on first execution
if not ws.global_env_vars:
access_token = request.headers.get("X-Access-Token")
ws.global_env_vars = await get_envs(access_token)
await ws.set_env_vars(ws.global_env_vars)

Fix in Cursor Fix in Web


Comment @cursor review or bugbot run to trigger another review on this PR

@mlejva mlejva merged commit aa45123 into main Aug 22, 2025
6 checks passed
@mlejva mlejva deleted the v2-prerelease branch August 22, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants