Run status should report what the run is waiting for
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- php, wordpress
- Domain
- api, backend-api-design
Research direction
Start with src/Runtime/class-wp-agent-chat-run-control.php and src/Channels/register-agents-chat-run-control-abilities.php; read normalize_run(), agents_chat_run_output_schema(), and the runtime-tool and pending-action entry points. Done means blocked runs expose verifiable required_actions IDs scoped to their run, non-blocked runs expose an empty list, and pending-action filtering supports run_id; verify the four required scenarios in the issue.
Written by the indexing model from the issue text.
Description
Problem
Two run statuses mean the run is blocked and waiting on someone: runtime_tool_pending and approval_required. The run payload says the run is blocked. It does not say what to act on.
A client that polls agents/get-chat-run and sees approval_required has to already know which subsystem blocked the run, then go find the row itself. For approvals there is no canonical way to do it: the pending-action list takes implementation-defined filters, so scoping by run is up to each store. The caller that is supposed to unblock the run cannot get from the run to the thing that unblocks it.
Evidence
src/Runtime/class-wp-agent-chat-run-control.php—STATUS_RUNTIME_TOOL_PENDINGandSTATUS_APPROVAL_REQUIREDare canonical statuses.src/Channels/register-agents-chat-run-control-abilities.php—agents_chat_run_output_schema()returnsrun_id,session_id,status, timestamps, and opaquemetadata. Nothing about what the run is waiting for.agents/resolve-pending-actionrequires anaction_id, andagents/submit-runtime-tool-resultrequires arequest_id. Neither id is reachable from the run payload.agents_pending_action_filters_input_schema()documents its filters as implementation-defined, so run scoping is not part of the contract.agents/list-runtime-tool-requestsdoes acceptrun_id, which is the shape to follow.
Required contract
- Add an optional
required_actionsarray to the canonical run payload, normalized inWP_Agent_Run_Control::normalize_run()so every run family gets it. - Each entry names the kind of action and the id to act on. Cover
runtime_tool_resultandpending_actionfirst, and leave the kind open for other blocking sources. - Populate it whenever the status is a blocked status, and leave it empty otherwise. A store that cannot supply it returns nothing rather than an invented entry.
- Add a canonical run filter to the pending-action list so the entry can be verified against a query.
Tests
- A run blocked on a runtime tool exposes an entry whose id is accepted by
agents/submit-runtime-tool-result. - A run blocked on an approval exposes an entry whose id is accepted by
agents/resolve-pending-action. - Running and completed runs expose an empty list.
- Two runs blocked in the same session never see each other's entries.
- Dominant language
- PHP
- Stars
- 33
- Forks
- 8
- Avg merge
- 1h 39m
- Merged PRs (30d)
- 30
Contributor guide
No contributing guide indexed for this repository
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 Automattic/agents-api
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Automattic/agents-api#552 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
Automattic/agents-api#551 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
Automattic/agents-api#549 ·
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
Automattic/agents-api#529 ·
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
Automattic/agents-api#489 ·
All issues in Automattic/agents-api
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·