Skip to content

fix: misc code quality improvements#1032

Open
123456wda wants to merge 1 commit into
cloudwego:mainfrom
123456wda:fix/misc-code-quality-improvements
Open

fix: misc code quality improvements#1032
123456wda wants to merge 1 commit into
cloudwego:mainfrom
123456wda:fix/misc-code-quality-improvements

Conversation

@123456wda

Copy link
Copy Markdown

Summary

  • compose/graph.go: Replace errors.New(fmt.Sprintf(...)) with idiomatic fmt.Errorf
  • adk/utils.go: Add empty input guard in concatInstructions to prevent potential index-out-of-bounds panic
  • adk/flow.go: Rename ok_/ok__ variables to descriptive names (isSubAgent, hasNext) for better readability
  • adk/react.go: Extract hardcoded maxIter value 20 to a named constant defaultMaxIterations

Test plan

  • go build ./compose/... ./adk/... passes
  • go test ./compose/... passes
  • go test ./adk/ passes

- compose/graph.go: use fmt.Errorf instead of errors.New(fmt.Sprintf(...))
- adk/utils.go: guard concatInstructions against empty input panic
- adk/flow.go: rename ok_/ok__ to descriptive variable names
- adk/react.go: extract hardcoded maxIter magic number to named constant

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@CLAassistant

CLAassistant commented May 18, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants