Skip to content

Change State.Tool() to return value instead of pointer to copy#21

Merged
ametel01 merged 1 commit into
mainfrom
fix/10-state-tool-return-value-semantics
Mar 14, 2026
Merged

Change State.Tool() to return value instead of pointer to copy#21
ametel01 merged 1 commit into
mainfrom
fix/10-state-tool-return-value-semantics

Conversation

@ametel01
Copy link
Copy Markdown
Owner

Summary

  • State.Tool() now returns (ToolState, bool) by value instead of (*ToolState, bool), eliminating the misleading pointer-to-copy pattern.
  • Updated all call sites in discovery, executor, and state packages.

Test plan

  • All existing tests pass without modification (they only read from the returned value)
  • make verify passes

Closes #10

🤖 Generated with Claude Code

State.Tool() now returns (ToolState, bool) by value, making copy
semantics explicit. Call sites in discovery, executor, and state
are updated to work with the value type directly.

Closes #10

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 14, 2026

Warning

Rate limit exceeded

@ametel01 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 23 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6dcc0eed-7fc4-4048-83b2-d1193c1db94a

📥 Commits

Reviewing files that changed from the base of the PR and between 194e07a and 4fa0ce4.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • internal/discovery/discovery.go
  • internal/plan/executor.go
  • internal/state/state.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/10-state-tool-return-value-semantics
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ametel01 ametel01 merged commit da56566 into main Mar 14, 2026
4 checks passed
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.

Change State.Tool() to avoid returning a pointer to a copy

1 participant