Skip to content

fix: return action results from action_invoke - #12

Merged
sciabarracom merged 1 commit into
apache:mainfrom
Adkid-Zephyr:codex/action-invoke-result
Aug 29, 2026
Merged

sciabarracom merged 1 commit into
apache:mainfrom
Adkid-Zephyr:codex/action-invoke-result

Conversation

@Adkid-Zephyr

Copy link
Copy Markdown
Contributor

Summary

  • invoke actions through the OpenServerless CLI's result-returning ops invoke alias
  • return the action's JSON response to the MCP client instead of an asynchronous activation ID
  • align the MCP description, README, and specification with the actual command
  • add regression coverage at the spawned ops process boundary

Root cause

action_invoke used ops action invoke. In the OpenServerless CLI, action is the generic wsk action wrapper, so this path invokes with blocking=false&result=false. Its successful output contains only an activation ID.

The CLI's dedicated invoke alias expands to wsk action invoke -r, which invokes with blocking=true&result=true and prints the action result.

Because this MCP exposes no follow-up activation-result tool, the old success response was a dead end for an agent: the action ran, but its result was unavailable.

Live verification

I exercised the checksum-verified Apache OpenServerless CLI release v0.9.1-2607122150.dev against a local mock OpenWhisk API:

  • before: blocking=false&result=false; MCP output ok: invoked /_/v1/demo with id activation-123
  • after: blocking=true&result=true; MCP output { "answer": 42 }

The request body remained { "key": "value" }, confirming parameter forwarding is unchanged.

Validation

  • npm test — 14 tests passed
  • npm run typecheck
  • git diff --check
  • independent structured review — no actionable findings

AI assistance

This contribution was developed with OpenAI Codex assistance. The submitter verified the upstream CLI contract, live behavior, patch, and tests. The commit includes a Generated-by: OpenAI Codex trailer.

@Adkid-Zephyr

Copy link
Copy Markdown
Contributor Author

Hi maintainers, a gentle follow-up on this PR. It fixes the default action_invoke path so callers receive the invoked action result, aligning the implementation with the documented tool contract, and includes a process-boundary regression test. The license workflow is currently awaiting approval to run. I am happy to address any feedback or adjust the approach. Thanks!

@sciabarracom
sciabarracom merged commit 6cb1366 into apache:main Aug 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants