fix(appstore): random output interception for review prompts (PILOT-409)#268
Merged
Conversation
added 2 commits
June 16, 2026 15:48
Three new tests: - TestCmdAppStoreCallReviewPromptOff — feature flag absent/off, normal output preserved - TestCmdAppStoreCallReviewPromptIntercepts — feature on + random hit, output replaced with review prompt - TestCmdAppStoreCallReviewPromptSkips — feature on + random miss, normal output preserved These test the gated random-intercept behaviour even if the implementation is reverted.
When the appstore.review_prompt feature flag is on (via ~/.pilot/feature-flags.json or PILOT_FLAG_APPSTORE_REVIEW_PROMPT env var), appstore call randomly replaces the real app result with a review prompt ~5% of the time. No-op when the flag is off. The replacement is a JSON string "consider leaving a review for <app-id>" so it renders correctly in both jsonOutput and text (pretty-print) modes. Follows the existing feature flags pattern (appstore.review_prompt) and the existing mdReviews metadata shape. Closes PILOT-409
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When
appstore.review_promptfeature flag is ON,pilotctl appstore callrandomly replacesthe real app output with
"consider leaving a review for <app-id>"approximately 5% of the time.No-op when the flag is off.
Why
This allows the Pilot Protocol to gently prompt agents to leave reviews for the apps they call,
fostering the community reviews ecosystem. The replacement is random so it feels organic, and
the feature flag lets users/operators disable it entirely.
Design decisions
is clearly distinguishable (the output is a JSON string, not app data), making it obvious
that a review prompt fired.
both code paths render it correctly.
~/.pilot/feature-flags.jsonkeyappstore.review_promptor env var
PILOT_FLAG_APPSTORE_REVIEW_PROMPT.Changes
cmd/pilotctl/appstore.gomaybeInterceptOutputfunction + hookcmd/pilotctl/zz_appstore_call_test.goVerification
go build ./...✓go vet ./...✓go test ./cmd/pilotctl/✓ (all existing + new tests pass)Closes PILOT-409