Skip to content

ADFA-7300: AI-Agent-MCP switch to let the Agent change app databases - #178

Open
davidschachterADFA wants to merge 1 commit into
sqlite-debugger/ADFA-7139from
sqlite-debugger/ADFA-7300
Open

davidschachterADFA wants to merge 1 commit into
sqlite-debugger/ADFA-7139from
sqlite-debugger/ADFA-7300

Conversation

@davidschachterADFA

@davidschachterADFA davidschachterADFA commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

ADFA-7300

Phase 2, P2-5 of the SQLite debugger (ADFA-7131 comment 41476, decision D14): AI-Agent-MCP lets the Agent use the debugger's execute tool, behind one switch, with the user's approval on every call. Stacked on #166 (sqlite-debugger/ADFA-7139); merge it after #166. On the device it needs CodeOnTheGo P2-3 (#2312, execute) and P2-4 (#2313, acknowledge_room).

What it does (plugins/AI-Agent-MCP)

  • The automatic SQLite debugger entry has no settings, so nothing could switch its execute on. David chose one switch (2026-11-25, ADFA-7300 comment 41560): "Let the Agent change app databases" at the top of the MCP servers screen, off by default, for every app (McpServerStore.allowDatabaseWrites). Changing it tells the change listeners, so the Agent's tool list follows.
  • ReadOnlyTrust.WRITE_TOOLS (execute) is offered only while the switch is on, and is never declared read-only, whatever hint the server sends (isReadOnly). So AI-Core asks before every call and never offers Always Allow for it.
  • A tooltip entry and long-press wiring for the switch; the README, ai-agent-mcp.html, the in-IDE help and the plugin tooltip are updated.
  • Version 2.1.0 / versionCode 4 (MINOR, on ADFA-7139: AI-Agent-MCP connects to the SQLite debugger automatically #166's 2.0.0 / 3).
  • With the switch on, each app offers five tools; in compact mode (4), AI-Core drops the first app's get_events (README).

Tests (local, at 7560587, unchanged from the cloud session's commit)

  • testDebugUnitTest: 358 tests in 69 classes, 0 failures. New: WriteToolTest (5: off by default even claiming the hint; on: offered, asks every time, not read-only; off again; listeners told; a hand-added server's execute stays an ordinary tool) and three ReadOnlyHintParsingTest cases (execute off unless writes are allowed; never read-only; allowing writes switches on no other tool).
  • Revert proof: without the WRITE_TOOLS exclusion in ReadOnlyTrust.isReadOnly, two tests fail: "execute is never read-only, even claiming the hint" (assertFalse(ReadOnlyTrust.isReadOnly(...))) and "with the switch on execute is offered, asks every time and is not read-only" (assertTrue(execute.requiresApproval())).
  • assemblePlugin: ai-agent-mcp.cgp, 10.3 MB, version 2.1.0. The addons check passes.

Not done yet: the MCP servers screen at font scale 1.0 and 2.0, light and dark, and the device checks on the Note 20 (the switch hides and shows execute; every call asks and Always Allow is never offered; the Room warning reaches the user): they need a Code on the Go build with P2-3 and P2-4, being prepared. Results will be added here and on ADFA-7300.

No other screens changed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn

Phase 2, P2-5 (ADFA-7131 comment 41476, decision D14). On #166
(sqlite-debugger/ADFA-7139 at 38b5268). Needs CodeOnTheGo P2-3 and
P2-4 (execute, acknowledge_room) on the device.

- The automatic SQLite debugger entry has no settings, so nothing could
  switch its execute on. David chose one switch (2026-11-25): "Let the
  Agent change app databases" at the top of the MCP servers screen, off
  by default, for every app (McpServerStore.allowDatabaseWrites). It
  tells the change listeners, so the Agent's tool list follows.
- ReadOnlyTrust.WRITE_TOOLS ("execute") is offered only while it is on,
  and never declared read-only, whatever hint the server sends
  (isReadOnly). So AI-Core asks before every call and never offers
  Always Allow for it.
- Tooltip entry and long-press wiring for the switch; README,
  ai-agent-mcp.html, the in-IDE help and the plugin tooltip updated.
- Version 2.1.0 / versionCode 4 (MINOR, on #166's 2.0.0 / 3).

With the switch on, each app offers five tools; in compact mode (4)
AI-Core drops the first app's get_events (README).

Tests: WriteToolTest (off by default even claiming the hint; on: asks
and not read-only; off again; listeners told; a hand-added server's
execute stays ordinary) and three ReadOnlyHintParsingTest cases. Not
run here: no Android SDK or AndroidX (dl.google.com is blocked), so
neither Gradle nor these tests ran. ReadOnlyTrust and McpTool were
compiled alone with a scratch check of the same rules (8 checks pass;
isReadOnly without the WRITE_TOOLS exclusion fails "execute never
read-only"). The addons check passes. Not run: testDebugUnitTest,
assemblePlugin, the device check, font scale 1.0 and 2.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAZ8yszEP4MqbR9PLba
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.

2 participants