Client run submits a task before rejecting nonpositive wait controls
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with the standalone artemis-client implementations of run(), run_task(), and wait_for_task(), following where timeout and poll_interval are validated relative to submit(). Add regression coverage using the injected transport interface to verify invalid controls make no transport calls through both entry points, while valid submit-and-complete behavior remains unchanged.
Written by the indexing model from the issue text.
Description
At 371aa6df56880643da57b30da936e9812fb0ec66, the standalone artemis-client package submits a task before rejecting a nonpositive timeout or poll_interval passed to run(); run_task() inherits the same behavior. The caller receives ValueError without a task handle, although a real server may already have started the submitted work.
run() awaits submit() before calling wait_for_task(), where those arguments are validated. Direct wait_for_task() already rejects them without a transport request. Expected: reuse those checks before task submission, keeping valid calls unchanged.
Credential-free reproduction using the package's injected transport interface (no server or device needed):
import asyncio
from artemis_client import ArtemisClient
class RecordingTransport:
def __init__(self):
self.calls = []
def request(self, method, path, *, json_body=None):
self.calls.append((method, path))
return {"status": "started", "tasks": [{
"session_id": "00000000-0000-4000-8000-000000000123",
"status": "pending",
}]}
async def main():
transport = RecordingTransport()
client = ArtemisClient("https://artemis.example.test", transport=transport)
try:
await client.run("Open Settings", timeout=0)
except ValueError as error:
print(type(error).__name__, str(error))
print(transport.calls)
asyncio.run(main())
Observed with Python 3.12 and the package source on PYTHONPATH:
ValueError timeout must be greater than zero
[('POST', '/api/run')]
Expected transport calls: []. Zero/negative values for both controls reproduce this through both run() and run_task(); a valid submit-and-complete control still succeeds. I have prepared a small fix with regression coverage and am checking contribution requirements before submitting the patch. I found no matching open issue or PR in the current inventory.
- Dominant language
- Python
- Stars
- 8.2k
- Forks
- 779
- Avg merge
- 20m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/artemis
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100