Skip to content

fix(actions): unknown platform search is an error, not an empty result (v1.55.5) - #192

Closed
tm07x wants to merge 1 commit into
withoneai:mainfrom
tm07x:fix/unknown-platform-search-exit
Closed

fix(actions): unknown platform search is an error, not an empty result (v1.55.5)#192
tm07x wants to merge 1 commit into
withoneai:mainfrom
tm07x:fix/unknown-platform-search-exit

Conversation

@tm07x

@tm07x tm07x commented Aug 29, 2026

Copy link
Copy Markdown

Summary

one --agent actions search bogus-platform-xyz "test" returned {actions:[]} with exit 0 and cached the miss. A typo was indistinguishable from a real platform with no matching actions, which breaks any flow that chains on search results.

On an empty search result, the CLI now looks the slug up in /available-connectors:

  • Unknown platform → exit 1, {error, similar, hint}, cache entry discarded
  • Known platform, no matches → unchanged ({actions:[]}, exit 0)

Catalog lookup is skipped when search already returned hits, so the happy path does not pay an extra request. If the catalog itself is unreachable, we fall through to the existing empty-result path rather than failing a genuine miss.

Test plan

  • actions search unknown platform (agent mode) — typo exits 1, no cache file, known-empty stays exit 0, hits skip the catalog
  • findPlatform / findSimilarPlatforms unit tests
  • execute _preflight still passes
  • tsc --noEmit
one --agent actions search bogus-platform-xyz "test"
# → {"error":"Unknown platform \"bogus-platform-xyz\"","similar":[...],"hint":"..."}  exit 1

one --agent actions search gmail "zzzz-no-such-action"
# → {"actions":[],"_cache":{...}}  exit 0

…t (v1.55.5)

`one --agent actions search bogus-platform-xyz "test"` returned
`{actions:[]}` with exit 0 and cached the miss, so a typo was
indistinguishable from a real platform with no matches.

On empty search results, look the slug up in the connector catalog.
Unknown platforms now exit 1 with `{error, similar, hint}` and are not
cached. A genuine empty match on a known platform is unchanged.
Copilot AI lite review requested due to automatic review settings August 29, 2026 15:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR changes one --agent actions search so that an unknown/misspelled platform slug is treated as an error (exit 1 with structured {error, similar, hint}) instead of returning an empty result and caching that miss, while preserving the existing behavior for known platforms with zero matches (exit 0 with {actions: []}).

Changes:

  • Add an unknown-platform check on empty action-search results by consulting /available-connectors, and drop any cache entry for the miss.
  • Add unit + integration tests covering findPlatform / findSimilarPlatforms and agent-mode search behavior (unknown vs known-empty vs hits).
  • Update user/agent-facing documentation to clarify the new error contract and caching behavior; bump version to v1.55.5.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/lib/platforms.test.ts Adds unit tests for platform lookup and similarity ranking.
src/lib/guide-content.ts Documents that unknown platforms in actions search are errors (exit 1) and are not cached.
src/commands/actions.ts Implements unknown-platform rejection on empty search results and defers cache writes until validated.
src/commands/actions.search-unknown.test.ts Adds agent-mode contract tests for unknown platform handling and cache behavior.
skills/one/SKILL.md Updates agent skill docs with the new actions search error/empty distinction.
README.md Updates quickstart examples to mention unknown-platform exit behavior.
package.json Version bump to 1.55.5.
package-lock.json Version bump to 1.55.5 (root + packages[""]).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

assert.equal(fs.existsSync(cachePath), false);
});

it('exit 0 with empty actions when the platform exists and the query matches nothing', async () => {
@tm07x tm07x closed this by deleting the head repository Aug 29, 2026
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