Skip to content

Make shell-hook prompting and state tracking idempotent#32

Merged
ametel01 merged 1 commit into
mainfrom
fix/26-idempotent-shell-hook-prompting
Mar 14, 2026
Merged

Make shell-hook prompting and state tracking idempotent#32
ametel01 merged 1 commit into
mainfrom
fix/26-idempotent-shell-hook-prompting

Conversation

@ametel01
Copy link
Copy Markdown
Owner

Summary

  • Suggestions() now accepts persisted state and skips tools with applied or declined hook status
  • ApplyConfirmedSuggestions() unconditionally reconciles state to applied, even when the init line already exists in the rc file
  • Re-running atb install no longer re-prompts for hooks that were previously applied or declined

Closes #26

Test plan

  • TestSuggestionsSkipsAlreadyApplied — applied hooks suppress re-prompting
  • TestSuggestionsSkipsDeclined — declined hooks suppress re-prompting
  • TestSuggestionsIncludesPreviouslySuggested — suggested-but-unresolved hooks still prompt
  • TestApplyReconcilesToAppliedWhenLineAlreadyExists — pre-existing rc line reconciles state
  • All existing tests pass, golangci-lint clean

🤖 Generated with Claude Code

Suggestions() now accepts persisted state and skips tools whose hook
status is already applied or declined. ApplyConfirmedSuggestions()
unconditionally reconciles state to applied, even when the init line
already exists in the rc file.

Closes #26

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 12 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: 3ad5f482-a77a-4f94-934c-6b3f1c429e06

📥 Commits

Reviewing files that changed from the base of the PR and between fab10b5 and 273446d.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • cmd/atb/runtime.go
  • internal/shell/shell.go
  • internal/shell/shell_test.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/26-idempotent-shell-hook-prompting
📝 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 f9ab45c 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.

Make shell-hook prompting and state tracking idempotent

1 participant