{"record":{"id":"16a7021697c31548","repo":"HKUDS/Vibe-Trading","slug":"unsupported-proposal-operation","errorCode":null,"errorMessage":"unsupported proposal operation","messagePattern":"unsupported proposal operation","errorType":"validation","errorClass":"ProposalError","httpStatus":400,"severity":"error","filePath":"agent/src/scheduled_research/proposals.py","lineNumber":184,"sourceCode":"        runtime = scheduler_status()\n        if not runtime[\"executable\"]:\n            raise ProposalError(\n                \"scheduled research executor is not enabled and running\"\n            )\n\n        store = default_store()\n        if payload[\"operation\"] == \"create\":\n            from src.scheduled_research.models import ScheduledResearchJob\n\n            job = ScheduledResearchJob.from_dict(payload[\"internal_job\"])\n            store.upsert(job)\n            payload[\"committed_job_id\"] = job.id\n        elif payload[\"operation\"] == \"cancel\":\n            if not store.delete(payload[\"job_id\"]):\n                raise ProposalError(\"scheduled research job no longer exists\")\n            payload[\"committed_job_id\"] = payload[\"job_id\"]\n        else:\n            raise ProposalError(\"unsupported proposal operation\")\n        payload[\"status\"] = \"committed\"\n        payload[\"committed_at\"] = int(time.time() * 1000)\n        _write(_path(proposal_id), payload)\n        return public_proposal(payload)\n\n\ndef discard_proposal(proposal_id: str) -> dict[str, Any]:\n    with _LOCK:\n        payload = _read(proposal_id)\n        if payload.get(\"status\") == \"pending\":\n            payload[\"status\"] = \"discarded\"\n            _write(_path(proposal_id), payload)\n        return public_proposal(payload)\n","sourceCodeStart":166,"sourceCodeEnd":198,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/scheduled_research/proposals.py#L166-L198","documentation":"Raised by commit_proposal when the stored proposal payload's `operation` field is neither 'create' nor 'cancel'. Proposals are created with a fixed operation, so hitting this branch means the proposal file on disk was hand-edited, written by an older/newer version, or corrupted.","triggerScenarios":"Calling commit_proposal on a proposal JSON whose operation is e.g. 'update', 'delete', or missing/typo'd; mixing proposal files between versions of the agent; tests writing proposal fixtures with invalid operation values.","commonSituations":"Manually crafting proposal fixtures in tests, schema drift after upgrading the scheduled-research module, or external tooling writing proposal files with unsupported operations.","solutions":["Inspect the proposal file at its storage path and check payload['operation'] is exactly 'create' or 'cancel'","Delete/recreate the malformed proposal through the normal propose_create/propose_cancel API","If you extended operations, update the elif chain in commit_proposal to handle the new value","Add a validation at proposal write time so only supported operations persist"],"exampleFix":"// before\nproposal = {\"operation\": \"update\", ...}\ncommit_proposal(pid)\n// after\nproposal = {\"operation\": \"create\", ...}  # or \"cancel\"\ncommit_proposal(pid)","handlingStrategy":"validation","validationCode":"import json\np = json.load(open(proposal_path))\nassert p.get(\"operation\") in {\"create\", \"cancel\"}, f\"bad operation: {p.get('operation')!r}\"","typeGuard":"def is_supported_operation(p: dict) -> bool:\n    return isinstance(p.get(\"operation\"), str) and p[\"operation\"] in {\"create\", \"cancel\"}","tryCatchPattern":"try:\n    commit_proposal(pid)\nexcept ProposalError as e:\n    if \"unsupported proposal operation\" in str(e):\n        discard_or_recreate_proposal(pid)","preventionTips":["Only create proposals via propose_create/propose_cancel APIs","Validate operation before committing in integration code","Don't hand-edit proposal files on disk"],"tags":["scheduled-research","proposal","validation","state-corruption"],"backgroundTag":"unsupported-operation-value","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}