Skip to content

Fix/product suggestion style - #4

Open
ZhiJiaXing-create wants to merge 5 commits into
v351-developfrom
fix/product-suggestion-style
Open

ZhiJiaXing-create wants to merge 5 commits into
v351-developfrom
fix/product-suggestion-style

Conversation

@ZhiJiaXing-create

Copy link
Copy Markdown
Owner

No description provided.

- keep the original casing of the unknown product/command token in error
  messages instead of lowercasing it
- route human and AI suggestions through one shared pipeline (close typo,
  then prefix) so prefix typos like "openapiex" also surface Did-you-mean
  hints in human mode
- reverse-look PascalCase/kebab root tokens up as API names across all
  products and suggest runnable full commands in the input's own style
  (e.g. "aliyun ecs DescribeRegions"), capped at the default suggest limit
- guard GetSuggestions against nil product and skip the overflow hint when
  no recovery command exists
- drop the unused removeDuplicates helper
- PascalCase command + kebab flag: InvalidParameterError now maps the flag
  through the API's metadata rename table (biz-region-id -> RegionId) and,
  when every assigned flag maps cleanly, shows the directly runnable
  equivalent kebab command
- kebab command + PascalCase API flag: the engine's UnknownFlagError is
  adapted host-side into a did-you-mean suggestion (verified against the
  engine's own option list) plus the equivalent PascalCase command, in both
  human and AI modes
- human and AI parameter suggestions now share one candidate computation
- missing-required errors on kebab commands clarify that --region only
  selects the signing/endpoint region when the user passed --region and the
  missing parameter is the region-ish one
- all style-mixing paths fail closed: unverifiable mappings fall back to the
  previous output unchanged
…ct (R08)

- AgentErrorEnvelope gains an always-present integer schema_version
  (protocol metadata, not error content), injected at the single
  NewAgentError construction point
- integrations.md (zh/en) now defines the field guarantees, the five-level
  AI-mode precedence chain, the version evolution rule, the JSON key-order
  non-contract, and the separation from the Machine Help v1 protocol
- flag help for --cli-ai-mode/--no-cli-ai-mode describes the real behavior
  instead of the historical User-Agent-segment wording
- tests lock the precedence chain, the explicit opt-out path, and the
  envelope shape; assertions parse JSON semantically rather than byte order
The styleMigrationTip test assumed the runtime engine serves no product
metadata, which held only in degraded local environments; with full CI
metadata the engine serves ecs and the equivalent-command branch fired
instead. Extract engineServedCommands as a package-level variable (the
established agentErrorNormalizer pattern) so tests pin the gate in both
directions, and add the previously untested served-command branch.
… errors

A --param-FILE flag means read-from-file on the PascalCase chain; stripping
the suffix would silently turn file content into a literal path value, and
the kebab engine has no per-parameter -FILE convention — the equivalent
command now declines to rebuild instead of emitting wrong advice. Also align
InvalidApiError/InvalidUnifiedApiError Error() with the nil guards their
suggestion methods already have.
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.

1 participant