HKUDS/Vibe-Trading · error · ValueError

job_id is required for propose_cancel

Error message

job_id is required for propose_cancel

What it means

The scheduled_research tool was invoked with action='propose_cancel' but no usable job_id kwarg. The tool strips whitespace and treats empty/missing values as absent, then raises ValueError before calling propose_cancel. It is a usage error from the tool's public execute method.

Source

Thrown at agent/src/tools/scheduled_research_tool.py:123

                ]
            }
        elif action == "get_job":
            job_id = str(kwargs.get("job_id") or "").strip()
            job = default_store().get(job_id)
            if job is None:
                raise ValueError(f"scheduled research job {job_id!r} was not found")
            payload = public_job(job)
        elif action == "list_playbooks":
            payload = {"playbooks": [item.to_dict() for item in list_playbooks()]}
        elif action == "propose_create":
            draft = kwargs.get("draft")
            if not isinstance(draft, dict):
                raise ValueError("draft is required for propose_create")
            payload = propose_create(draft, session_id=session_id)
        elif action == "propose_cancel":
            job_id = str(kwargs.get("job_id") or "").strip()
            if not job_id:
                raise ValueError("job_id is required for propose_cancel")
            payload = propose_cancel(job_id, session_id=session_id)
        else:
            raise ValueError(f"unsupported scheduled_research action {action!r}")
        return json.dumps(payload, ensure_ascii=False)

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Pass a non-empty job_id kwarg, e.g. {"action": "propose_cancel", "job_id": "<id from propose_create response>"}
  2. If you don't know the job_id, first list/lookup scheduled jobs (e.g. via the propose_create response payload or the scheduling API) to obtain it
  3. Ensure upstream code forwards the job_id returned when the job was proposed instead of dropping the field

Example fix

# before
result = tool.execute(action="propose_cancel")
# after
result = tool.execute(action="propose_cancel", job_id="job-2024-001")
Defensive patterns

Strategy: validation

Validate before calling

job_id = (kwargs.get("job_id") or "").strip()
if not job_id:
    raise RuntimeError("need job_id from the propose_create response before cancelling")
result = tool.execute(action="propose_cancel", job_id=job_id)

Prevention

When it happens

Trigger: Calling the scheduled_research tool with {"action": "propose_cancel"} without job_id, or with job_id set to "" / None / a whitespace-only string (str(kwargs.get("job_id") or "").strip() is empty).

Common situations: An LLM agent or script composes the tool call and omits job_id because it doesn't know the previously created job's ID, or passes job_id=0/empty string assuming it defaults.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28). Data as JSON: /api/errors/905976b9ec2edd28. Report an issue: GitHub.