Text-only tool results arrive as null under OpenClaw Code Mode (signup flow undiscoverable)

Open Beginner friendly
#46 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
tooling

Research direction

Start with toolTextResult() in dist/tool-result.js and compare it with toolJsonResult(), which already includes details. Update the text-result path so Code Mode receives a non-null details payload while preserving existing content. Verify that credential, signup, validation, and adapter text results reach the agent with their messages visible.

Written by the indexing model from the issue text.

Description

Summary

Under OpenClaw Code Mode, every text-only result from this plugin reaches the agent as null. This includes "No credentials found…", the eg_travel_signup / eg_travel_verify confirmations, validation errors and adapter errors. Because the agent never sees "No credentials found. Call eg_travel_signup…", it cannot discover that it needs to start the signup flow. Instead it concludes that the tool is unavailable.

Environment
  • Plugin: @expediagroup/expedia-openclaw v1.0.4 (ClawHub, official channel)
  • OpenClaw 2026.12.2, Code Mode active (auto tier, Gemini Flash model). The model sees only exec / wait, and plugin tools are called as async globals inside exec.
Cause

OpenClaw Code Mode returns a native tool's JSON details value to guest code, not its content text (OpenClaw docs: tools/code-mode/guest-api: "Calling a native global or native catalog handle returns the normal tool's JSON details value directly"). toolTextResult() in dist/tool-result.js omits details when none is passed:

export function toolTextResult(text, details) {
    return {
        content: [{ type: "text", text }],
        ...(details !== undefined && { details }),
    };
}

toolJsonResult() already sets details, so search results work once credentials exist. Only the text paths are affected.

Steps to reproduce
  1. Install the plugin without credentials (~/.oc/credentials/eg-travel.json absent).
  2. Under Code Mode, have the agent run await search_flights({...}) or await eg_tenant_status().
  3. The guest receives null. The model reports that Expedia is unavailable and never calls eg_travel_signup.
Suggested fix

Always populate details for text results, e.g.:

export function toolTextResult(text, details) {
    return {
        content: [{ type: "text", text }],
        details: details !== undefined ? details : { message: text },
    };
}

We applied this locally. The agent then received "No credentials found…", ran eg_travel_signup → eg_travel_verify, and completed a live flight search. For error paths, setting isError: true would also work, since OpenClaw copies the text into message for error results without one.

Dominant language
TypeScript
Stars
4
Forks
2
Avg merge
1h 46m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ExpediaGroup/expedia-openclaw

All issues in ExpediaGroup/expedia-openclaw

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.