Skip to content

th-a78e1e: rename current_datetime → get_current_datetime (stop auto-mode prompts) - #428

Merged
brentrager merged 2 commits into
mainfrom
th-a78e1e-datetime-safe
Aug 13, 2026
Merged

th-a78e1e: rename current_datetime → get_current_datetime (stop auto-mode prompts)#428
brentrager merged 2 commits into
mainfrom
th-a78e1e-datetime-safe

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Problem

Big Smooth's auto-mode (AcceptEdits) prompted the user before every clock read:

current_datetime is not a recognised safe tool. Allow current_datetime?

Auto-mode has no "problematic tools" list — it auto-allows tools it recognises as safe and asks about the rest. The engine's classifier (smooth_operator::permission::tool_category) grades a tool by name: get_*/read_*/list_*/*search* → read-only-safe (silent), mutating names → edit (silent under AcceptEdits), everything else → Unknown → ask. The clock tool is a pure, argument-free read, but the bare name current_datetime had no safe prefix, so it fell into Unknown and prompted.

Fix

Rename the tool current_datetimeget_current_datetime so the classifier recognises it as a safe read and auto-allows it (same reason read_file/list_files never prompt).

  • Regression test asserts the engine returns Verdict::Allow for the name under AcceptEdits — fails loudly if the name loses its get_ prefix or the heuristic moves.
  • Module note so nobody "tidies" the name back.
  • Updates the persona roster, the family safe-read allow-list (family.rs + ADR-008), the reminders relative-date guidance, and Using-th-CLI.md.

Not in scope (tracked)

  • th-cc0894 — wire the "always allow" grant (don't-ask-again) + a UI button. It's deliberately unwired today because SharedGrants was private in the pinned core; that's why there's only Yes/No.
  • th-4c71a6 — engine: classify tools by a declared read_only/safe flag instead of the name heuristic, killing the whole class (create_artifact, remember, calendar/reminders reads) once the daemon catches up off core 1.7.0.

Verification

  • cargo test -p smooai-smooth-tools --lib → 263 passed (incl. new tool_name_is_classified_safe_and_auto_allowed)
  • cargo test -p smooai-smooth-policy --lib family → 11 passed
  • cargo build -p smooai-smooth-daemon → clean

🤖 Generated with Claude Code

…de stops prompting

The engine's permission classifier grades a tool by name: get_/read_/list_
prefixes are read-only-safe and auto-allowed, mutating names are edits (also
auto-allowed under AcceptEdits), and everything else falls into Unknown ->
ask. The clock tool `current_datetime` is a pure, argument-free read but its
name had no safe prefix, so it landed in Unknown and AcceptEdits prompted the
user before every clock read ("current_datetime is not a recognised safe
tool. Allow?").

Rename it to `get_current_datetime` so the classifier recognises it as a safe
read and auto-allows it, matching read_file/list_files. Adds a regression
test asserting the engine actually returns Verdict::Allow for the name under
AcceptEdits, plus a module note so it isn't renamed back. Updates the persona
roster, the family safe-read allow-list, the reminders relative-date guidance,
and the docs.

Broader class fix tracked separately: engine metadata-based classification
(th-4c71a6) and wiring the "always allow" grant + UI button (th-cc0894).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@brentrager
brentrager enabled auto-merge (squash) August 13, 2026 02:33
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 65f1405

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smooai/smooth Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brentrager
brentrager merged commit 383a92c into main Aug 13, 2026
3 checks passed
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.

1 participant