Skip to content

fix(codegen): drop module prefix from operation command names - #103

Merged
samzong merged 1 commit into
mainfrom
fix/drop-module-prefix-opname
Jul 25, 2026
Merged

fix(codegen): drop module prefix from operation command names#103
samzong merged 1 commit into
mainfrom
fix/drop-module-prefix-opname

Conversation

@samzong

@samzong samzong commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Strip a leading operationId segment when it matches the module name (in addition to the group name), so names like console_listApps become list-apps instead of console-list-apps.
  • Keep the existing guard against blind prefix stripping, which would collapse CRUD verbs (create_chunk / update_chunk / delete_chunk) onto one command name.
  • Add a focused unit test for the module-prefix path.

Verification

go test ./internal/codegen/normalize/ -count=1

Compatibility

Generated command Use names may shorten when an operationId is prefixed with the module name. Group-prefix behavior is unchanged. Catalog schema, auth, body, and output format are unaffected.

Checklist

  • Tests or focused verification cover the changed surface.
  • User-facing behavior changes are documented.
  • Generated output under internal/generated/, .cache/, and ad-hoc skills/<cli-name>/ directories is not committed.
  • Commits are signed off when this is ready to merge.

Considered and deferred

  • internal/codegen/normalize/normalize.go:267 [BOT-NIT]: Missing parentheses around the && clause is less readable but Go precedence is correct; not changing.

Strip leading operationId segments that match the module name so
commands like console_listApps become list-apps instead of console-list-apps.

Signed-off-by: samzong <samzong.lu@gmail.com>

## Considered and deferred

- internal/codegen/normalize/normalize.go:267 [BOT-NIT]: Missing parentheses around the && clause is less readable but Go precedence is correct; not changing.
@samzong
samzong merged commit 10de4d6 into main Jul 25, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49c3a36dbc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/codegen/normalize/normalize.go
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