Repository navigation
fix(ai): invoke OpenClaw through its agent command - #1308
Merged
Merged
Conversation
- Use openclaw agent --message instead of the unsupported top-level -p option, keeping prompt text as one argument. - Give every AI task a fresh UUID session so parallel enrichment never shares the member's conversation or requests external reply delivery. - Preserve the existing plain-text response, process error and timeout handling for callers and other CLI backends. - Verify 19 AI-client tests, build, typecheck and lint, and a real-CLI code import with an isolated OpenClaw fixture producing the inferred domain metadata. Related to Tencent#1221.
|
No confident findings in the PR’s three-file diff.
The checkout’s shallow history prevented the three-dot command; I reconstructed the PR diff using the verified common parent, |
SaulMoro
approved these changes
Oct 23, 2026
SaulMoro
left a comment
Collaborator
There was a problem hiding this comment.
This was generated by AI during triage.
@nateEc Thanks, approving. This closes the #1221 item "ai-client runs openclaw -p, which OpenClaw does not accept".
We ran teamai import with the built CLI on this head and on its base 97f1e7b4, against a stand-in openclaw that logs its argv:
| build | argv sent | result |
|---|---|---|
| base | -p <prompt>, four times |
every call fails (unsupported argv), no domain written |
| this PR | agent --session-id <uuid> --message <prompt>, four distinct UUIDs |
_domains.json has the stand-in's domain |
Both runs exit 0. tsc, lint, the unit tests and the new e2e pass. Both new test files fail on the base.
Not blocking:
[P2 non-blocking]callClaudebuilds its error from stderr only (src/utils/ai-client.ts:153-154). Ifopenclaw agentreports a failure on stdout, the message is justAI call failed:. We read this from OpenClaw's package, not from a real run.[P2 non-blocking]Each call creates a new OpenClaw session that persists after the run. A sentence in the body or docs would help, and so would saying whetheropenclaw agentneeds the Gateway running for a headless import.[P3 nit]Two JSDoc blocks inai-client.tsstill list-pas the call form.
49 of 52 tasks
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
- Use openclaw agent --message instead of the unsupported top-level -p option, keeping prompt text as one argument. - Give every AI task a fresh UUID session so parallel enrichment never shares the member's conversation or requests external reply delivery. - Preserve the existing plain-text response, process error and timeout handling for callers and other CLI backends. - Verify 19 AI-client tests, build, typecheck and lint, and a real-CLI code import with an isolated OpenClaw fixture producing the inferred domain metadata. Related to Tencent#1221.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The AI backend selected OpenClaw but ran the unsupported top-level
-poption, so enrichment could never get a model reply. Invokeopenclaw agent --session-id <fresh UUID> --message <prompt>instead. Each task has its own session, with no external-channel delivery flag; stdout remains the plain answer callers expect.Type of Change
Test Plan
ai-client-openclaw.test.tsandai-client.test.ts.npm run build,npx tsc --noEmit,npm run lint, andgit diff --checkpassed.ee7739a:Related Issues
Related to #1221, one specific item in "Other findings". This PR does not close the umbrella issue or include its descriptor/resolver redesign.
Notes for Reviewers
Syntax checked against OpenClaw agent documentation and its agent-via-gateway source. No live model tokens were used; the test exercises the built TeamAI CLI and OS subprocess boundary with a fake OpenClaw response. Other backends' argv, output/error handling and timeouts stay unchanged.
Integration verification: all five independent fixes cherry-picked cleanly onto origin/main in a local-only checkout; combined build, typecheck and lint passed, with 174 unit tests and 7 real-CLI cases across 6 E2E files. The Windows test-list guard and moved POSIX command regression also pass together (25 tests).