Repository navigation
feat: add thinking level picker - #18
Conversation
1eaa803 to
368bdbc
Compare
- add a Telegram picker for model-supported thinking levels - show the active thinking level after session and model changes - update Pi SDK packages to 0.80.6
368bdbc to
5f795dc
Compare
|
@benedict2310 let me know if you're interested in the thinking level picker. If you are, I would resolve the merge conflicts. |
|
Awesome, I'd course! I'll have a look and merge tonight |
benedict2310
left a comment
There was a problem hiding this comment.
The implementation is compatible with Pi 0.82.1 and the model-specific supported-level validation is a good foundation. CI/build pass, but two issues need addressing before merge:
-
The new state-changing Telegram flow has no behavioral tests. Current additions only extend mocks and verify command registration. Please add tests for picker buttons/current marker, no supported levels, successful selection/edit, unsupported crafted callback, expired session, and busy/streaming rejection; also directly test
PiSessionService.getThinkingLevels()andsetThinkingLevel()validation. -
Callback data is only
thinking_<level>. An old picker remains actionable after switching session/model and can mutate the newly active session when the level happens to be supported. Bind the callback to the session/model or track picker state and reject stale buttons, as the existing picker flows do.
Minor: add /thinking to the plain/HTML help output so the command list remains complete.
- align thinking callbacks with existing picker state handling - expire thinking buttons after session or model changes - add behavioral and service validation coverage - include the thinking command in help output
|
@benedict2310 pushed the changes you requested. Let me know if it's good now, or if you want something done differently. |
benedict2310
left a comment
There was a problem hiding this comment.
Thanks — commit d3695a9 addresses the help output, service validation, model-change invalidation, and much of the requested behavioral coverage. Focused tests (192), full suite (433), coverage, build, and CI all pass. One merge blocker remains: session-change invalidation is incomplete.\n\n- In the callback session switch path, src/bot.ts calls switchSession and clears tree/prompt state, but does not clear pendingThinkingPicks.\n- The newws_ callback similarly replaces the session without invalidating an existing thinking picker.\n- Extension-driven newSession/switchSession in src/bot/prompt-handler.ts also bypass bot-owned picker invalidation.\n\nA user can therefore open /thinking, replace the active session through one of these paths, then click the old button and mutate the new session when that level is supported. Please either bind each pending thinking picker to session/model identity and validate that identity in the callback (the more robust option), or ensure every successful session replacement invalidates it. Add regression tests covering switch_, newws_, and extension-driven replacement. Once those pass, this should be ready to approve and merge.
- bind thinking picker state to the active session and model - reject buttons after callback and extension session replacements - add regression coverage for all session replacement paths
|
Adopted your requested changes. |
benedict2310
left a comment
There was a problem hiding this comment.
Re-reviewed 1e32188. The remaining blocker is resolved: thinking picker state is now bound to the active session ID and model, so stale buttons expire after switch_, newws_, and extension-driven newSession/switchSession replacements. The requested regression tests are present. Local validation passed: focused tests 204/204, full suite 437/437, coverage thresholds met, TypeScript build passed, and GitHub CI is green. Approving and merging.
Summary
This adds a
/thinkingcommand with a Telegram picker. The picker only shows the thinking levels supported by the current Pi model and marks the active level.Session creation and model switch messages now show the active thinking level. This makes it clear which setting the next prompt will use.
The Pi SDK packages are updated to version 0.80.6 so TelePi uses the current thinking level support and the new GPT-5.6 models.
Screenshot
Tests
npm run buildnpm test