Skip to content

fix(channels): ask before /model Local only turns the Local only switch on - #451

Merged
itsskofficial merged 1 commit into
existence-master:mainfrom
Venius24:fix/channel-local-only-confirm
Oct 18, 2026
Merged

itsskofficial merged 1 commit into
existence-master:mainfrom
Venius24:fix/channel-local-only-confirm

Conversation

@Venius24

@Venius24 Venius24 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What and why

In a messaging app, /model Local only switched the models but left the Local only switch off, because there was no confirmation step. Now it asks "Turn on Local only too, so nothing leaves this computer? Reply /model Local only yes", and /model Local only yes does what the desktop does: the preset and the switch go on in one save (undo puts both back). It only asks when the switch is off. Only paired chats reach /model at all (#385).

Closes #446

How I tested it

  • New tests in tests/channels/test_model_command.py, using the fake Telegram API: asks first and changes nothing; yes turns on preset and switch; undo restores the switch; numeric pick (/model 1) asks too; no question when the switch is already on.
  • pytest tests/channels tests/test_model_presets.py tests/test_local_only.py: 190 passed, 1 skipped.
  • ruff check sentient tests: clean.

Real test

  • Setup: not run end to end. Only the offline test suite.
  • Model: no model involved.
  • Not tested: a real Telegram/Discord/WhatsApp chat. Button taps on the preset list still apply the preset without the question; I kept this PR to the typed command from the issue.

Checklist

  • Tests added or updated, and pytest passes locally for what I touched
  • ruff check sentient tests is clean
  • docs/API.md not affected (no contract change)
  • Changelog entry changes/446.fixed.md
  • No keys, tokens or personal data

Summary by CodeRabbit

  • New Features
    • In Telegram, Discord, and WhatsApp, selecting the Local only model preset now asks for confirmation before enabling Local only. Reply yes to apply the preset and turn on the setting together.
    • If Local only is already enabled, selecting the preset does not ask for confirmation.

In Telegram, Discord and WhatsApp, /model Local only now asks for a yes
(like the desktop dialog) and /model Local only yes switches the models
and the Local only switch together; undo puts both back.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot added the area: channels Telegram, Discord label Oct 17, 2026
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 00ab0421-1473-4815-b907-ca261838b71f
📥 Commits

Reviewing files that changed from the base of the PR and between 841de48 and e1c7699.

📒 Files selected for processing: 3
  • changes/446.fixed.md
  • sentient/channels/base.py
  • tests/channels/test_model_command.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The model command prompts for confirmation when a user selects the Local only preset while the Local only setting is off. A trailing yes applies the preset and enables the setting.

Changes: Local only model command

Layer / File(s) Summary
Confirm and apply Local only
sentient/channels/base.py, tests/channels/test_model_command.py, changes/446.fixed.md
The command recognizes a trailing yes and prompts before enabling Local only. After confirmation, it applies the preset and enables the setting. Tests cover selection by name and number, confirmation, undo, and the already-enabled case. The changelog describes the behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to e1c76

The confirmation flow is ready to merge after normal checks. Numeric confirmation uses the same path that enables the preset and Local only setting together.

Security architecture risk: 🟡 Moderate · up to e1c76

The normal confirmation flow preserves existing access checks and enables local processing together with the selected preset. However, a configuration-save failure can leave the setting appearing enabled while running requests still use the previous configuration. Retrying the command may not repair that mismatch.

Retained concerns

  • Medium · security · inferred: The newly confirmed channel activation can leave Local only enabled in application configuration but disabled in the running provider after a configuration-file write failure. The save operation publishes the new application configuration before persistence, while provider updates occur afterward. Failure handling restores only undo metadata. A retry sees the switch already enabled and can return through preset application's no-change path without updating the provider, allowing subsequent requests to retain the previous cloud-capable configuration. The persistence defect predates this PR, but the command now exposes this privacy-control transition through an additional entrypoint.
Security review details

Security Blast Radius

  • inferred — The affected scope is one application's shared model configuration, not merely the requesting chat. A failed activation can therefore affect subsequent model requests from other chats or background work sharing the old provider configuration. No cross-installation or additional tenant exposure was established.

Security Findings and Attack Paths

  • inferred — The supported concern is a failure-induced privacy-control mismatch, not an unauthenticated command bypass. It requires an authorized activation and a configuration-write failure; subsequent provider requests can retain the old locality policy. Actual outbound disclosure under this condition was not reproduced.

Trust Boundaries and Controls

  • observed — Typed model commands remain behind paired-chat checks and the paired-owner restriction for groups. Successful activation validates local roles, and the provider independently rejects non-local models when its Local only setting is enabled. No new unpaired-user reachability was identified.

Resilience and Maintainability Implications

  • observed — An unexpected save exception produces an error response rather than falsely acknowledging success. However, the handler does not restore configuration consistency, and preset application's no-change return does not resynchronize the provider.
Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: the /model Local only command now asks for confirmation before enabling the Local only switch.
Linked Issues check Passed Issue #446 requires a confirmation when the Local only preset is selected while the switch is off. The shared sentient/channels/base.py command path now asks the question and accepts the trailing `y…
Out of Scope Changes check Passed The changes stay within issue #446. The production change updates the shared /model command and preset outcome handling. The tests verify the requested confirmation behavior. changes/446.fixed.md …
Docstring Coverage Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 u…
Full details: Linked Issues check

Explanation

Issue #446 requires a confirmation when the Local only preset is selected while the switch is off. The shared sentient/channels/base.py command path now asks the question and accepts the trailing yes confirmation. The confirmed path applies the preset and enables local_only in one operation. The tests cover name selection, numeric selection, confirmation, undo, and the already-enabled case. The shared channel implementation covers Telegram, Discord, and WhatsApp. The supplied evidence states that only paired chats reach /model, which limits the response to the chat owner.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #446. The production change updates the shared /model command and preset outcome handling. The tests verify the requested confirmation behavior. changes/446.fixed.md documents the fix. No unrelated change is shown.

Full details: Docstring Coverage

Explanation

Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit taps /model with care,
“Local only?” hops through the air.
A yes sets the preset in place,
And turns the switch on at the same pace.
Then carrots celebrate the case.

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

@Venius24

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Oct 17, 2026
@Venius24

Copy link
Copy Markdown
Contributor Author

recheck

@itsskofficial itsskofficial left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Venius24, this works well! I tested it on a real engine with a fake Telegram API:

  • /model Local only asks first;
  • /model Local only yes turns both on (REST shows local_only=true and the preset active);
  • /model undo puts both back;
  • there's no question when the switch is already on;
  • in a group, a member who isn't the owner can't answer yes or undo.

It also reuses the desktop's preset logic from #428 instead of duplicating it, which is exactly right.

Two small things I'll take as follow-ups, so no need to change this PR:

  • tapping the Local only button in the /model list still applies the preset without asking;
  • /model Local only no replies "I don't have a model setup called 'Local only no'", where it could just cancel.

Approving and merging. Thanks!

@itsskofficial
itsskofficial added this pull request to the merge queue Oct 18, 2026
Merged via the queue into existence-master:main with commit 7e90c87 Oct 18, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: channels Telegram, Discord

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C:/Program Files/Git/model Local only in a messaging app should also turn on the Local only switch (with a confirmation)

2 participants