Fix _submission_ui_json RuntimeError in no-auth HTTP mode#220
Conversation
Skip ownership recording (store_task_owner) when require_auth is False, since there is no authenticated user in --no-auth mode. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@claude code review |
|
Claude finished @RafaelPo's task in 1m 36s —— View job Code Review: Fix _submission_ui_json RuntimeError in no-auth HTTP mode
Overall: The core fix in Bug:
|
| Finding | Severity | Status |
|---|---|---|
_check_task_ownership needs require_auth guard |
Bug | Needs fix |
_validate_task_owner REST route needs require_auth guard |
Bug | Needs fix |
| Missing test coverage for progress/results in no-auth mode | Testing gap | Recommended |
| Fixture duplication | Nit | Optional |
The submission fix itself is correct and well-motivated. The two downstream bugs should be addressed before merging to avoid a "submit works but nothing else does" experience in --no-auth mode.
The widget is never rendered in no-auth mode (no Claude Desktop), so skip it entirely in create_tool_response. _submission_ui_json keeps its strict auth requirement — it is only called in auth HTTP mode now. The task token is still stored for progress polling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| if settings.is_http and settings.require_auth: | ||
| ui_json = await _submission_ui_json( | ||
| session_url=session_url, | ||
| task_id=task_id, |
There was a problem hiding this comment.
Bug: In no-auth HTTP mode, task submission correctly skips storing an owner, but follow-up calls like everyrow_progress incorrectly still perform an ownership check, causing them to fail.
Severity: MEDIUM
Suggested Fix
In tools.py, update the condition in _check_task_ownership() to also check for settings.require_auth. Change if not settings.is_http: to if not settings.is_http or not settings.require_auth:. This will bypass the ownership check when authentication is disabled, aligning it with the task submission logic.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: everyrow-mcp/src/everyrow_mcp/tool_helpers.py#L142-L145
Potential issue: The new code correctly skips recording task ownership when running in
no-auth HTTP mode (`require_auth=False`). However, the corresponding ownership check in
`_check_task_ownership()` was not updated. This function is called by tools like
`everyrow_progress()` and `everyrow_results_http()`. It still attempts to verify
ownership if `settings.is_http` is true, without considering `settings.require_auth`. As
a result, after submitting a task in no-auth mode, any attempt to check its progress or
retrieve results will fail with an "Access denied" error because no owner was ever
stored.
Did we get this right? 👍 / 👎 to inform future reviews.
Summary
_submission_ui_jsonraisedRuntimeErrorwhenget_access_token()returnedNonein--no-authHTTP mode, because ownership recording was gated only onsettings.is_httprequire_authfield toSettings(defaultTrue), set toFalseby--no-authCLI flagtool_helpers.pyfromif settings.is_httptoif settings.is_http and settings.require_authto skip ownership recording in no-auth mode_noauth_http_statetest fixture andtest_submit_task_noauth_httpe2e testTest plan
test_submit_task_noauth_httpverifies task submission succeeds without an access tokenscripts/run-no-auth.sh+scripts/mcp_call.py call everyrow_screen '...'succeeds🤖 Generated with Claude Code