Fix #31: bot_username populated, Powerful preset = Opus, document Vite tunnel quirk#36
Merged
Merged
Conversation
…e tunnel quirk
Three minor observations from the 5.19 E2E bundled into one PR per the
ticket grouping.
(a) AgentTelegramConnection.bot_username was null after a successful
connection because TelegramConnectionController::store wrote
bot_token but never called Telegram's getMe to capture username.
Now resolves it via a 10s HTTP timeout, logs+swallows failures so
a Telegram outage doesn't break the connect flow, and stores the
@username for UI display ("Connected as @scout_e2e_bot").
(b) ModelTier::Powerful->primaryModel() returned 'claude-sonnet-4-6'
despite the UX copy describing the tier as Opus ("Best reasoning
and creativity", "~$50/mo"). Fixed to return Opus primary;
fallback chain also de-duplicated to ['claude-sonnet-4-6'] (was
['claude-opus-4-6','claude-sonnet-4-6'] which was wrong on both
sides — Opus was already primary candidate but listed in fallback
and Sonnet was listed once redundantly).
(c) Documented the Vite + herd share tunnel quirk in CONTRIBUTING.md
so the next developer running the E2E doesn't burn 30 min
figuring out why their first navigation renders blank.
Tests: 6 new tests cover both the success and graceful-failure paths
of the bot_username lookup, and the Powerful / Efficient /
Subscription tier primary+fallback chains. Full suite: 685 passed,
106 skipped.
Fixes #31
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.
Summary
Three minor observations from the 5.19 E2E bundled into one PR per the ticket grouping.
Fixes #31.
a)
bot_usernameis now populated after Telegram connectTelegramConnectionController::storewrote the token + status but never called Telegram'sgetMeendpoint, leavingbot_usernamenull on every row. The UI couldn't display "Connected as @scout_e2e_bot".Now the controller calls
https://api.telegram.org/bot{token}/getMewith a 10s timeout and stores theusernamefrom the response. Failures (network down, Telegram outage, invalid token) are caught, logged at warning, and the connect flow still succeeds — the row gets created withbot_username=nullrather than the user seeing an error.b)
Powerfultier primary model is now OpusThe agent wizard's "Powerful" tier card reads:
…but
ModelTier::Powerful->primaryModel()returnedclaude-sonnet-4-6, with Opus only listed in the fallback chain. Sonnet is roughly $3/Mtok input vs Opus's $15/Mtok — the cost estimate and the copy implied Opus, but the actual config used Sonnet primary.Fixed:
primaryModel()returnsclaude-opus-4-6fallbackModels()returns['claude-sonnet-4-6'](was['claude-opus-4-6', 'claude-sonnet-4-6']— Opus listed in fallback when it was already primary candidate, and Sonnet listed redundantly)c) Vite +
herd sharereload quirk documented in CONTRIBUTING.mdTwo real failure modes when running
composer run devalongsideherd share:npm run buildonce +rm public/hotso Herd serves static built assets directly.These cost ~30 min of debugging time during the E2E session; documenting them so the next dev hits a cheaper learning curve.
Tests
6 new tests across two files. Plus inline
Http::fakefor the Telegram bot_username flow:tests/Feature/Enums/ModelTierTest.php(4): Powerful tier primary = Opus, fallback chain has no duplicate, Efficient remains Haiku+Sonnet, Subscription is GPT-5.5 with ChatGPT auth.tests/Feature/Agents/TelegramConnectionTest.php(2 new): bot_username populated from successful getMe, and the connect flow degrades gracefully when getMe fails (500 from Telegram).Full suite:
Pint: clean.
Live E2E status
php artisan tinker --execute='echo App\Models\Agent::latest()->first()->model_primary;'(or check via the UI's "Model" badge) → expect Opus, not Sonnetphp artisan tinker --execute='echo App\Models\AgentTelegramConnection::latest()->first()->bot_username;'→ expect the bot's @username, not nullTest plan