Skip to content

Add local AI group naming - #69

Open
johnpierson wants to merge 9 commits into
masterfrom
codex/experiment-local-group-naming
Open

johnpierson wants to merge 9 commits into
masterfrom
codex/experiment-local-group-naming

Conversation

@johnpierson

Copy link
Copy Markdown
Owner

What this does

Adds an opt-in local group naming experiment to Monocle: a menu toggle downloads a pinned llama.cpp CPU runtime + Qwen3-4B-Q4_K_M (with license acceptance, SHA-256 verification, and an immutable-revision download URL) and runs it on localhost. While enabled, groups created from the FOCA flyout get an AI-suggested 3-7 word title, with a cursor-following indicator during inference. Node names never leave the machine.

Hardening on top of the original experiment

The branch was rebased onto master (post-#67) and went through a multi-agent review; 28 verified findings were fixed:

  • No user-data loss: only newly created groups are auto-named — recoloring an existing group no longer overwrites its title; created annotations are resolved by id instead of Annotations.Last(); the rename goes through UpdateModelValueCommand alone so Ctrl+Z restores the previous title; renames are skipped if the group was deleted/undone or the workspace changed mid-inference.
  • Process lifecycle: llama-server is tied to the host via a kill-on-close job object (no orphaned ~2.5 GB process after a Revit/Dynamo crash); thread-safe enable/disable with session-scoped cancellation; no server restart after disable; no UI-thread blocking on teardown.
  • UX: group creation keeps working while a naming call is in flight; the indicator clamps to the real window bounds when Dynamo is maximized; progress UI dismisses before error dialogs; disable-induced errors are silent.
  • Provisioning: cross-process install lock for the shared %LOCALAPPDATA% install, marker invalidation before reinstall, stale-download cleanup before the disk check, and a size cap on the model download.
  • Robustness: misconfigured MONOCLE_LOCAL_AI_* env vars disable only this feature instead of aborting Monocle's Loaded.

Verification

  • Builds clean (0 errors) on Release 4.1 (net10), 2.19 (net48), and 2.0 (oldest Dynamo package API)
  • tests/Monocle.LocalGroupNaming.Tests passes and now runs in CI

Notes for review

  • artifacts/Monocle-LocalNaming-Dynamo4.1.zip (10 MB test bundle) is committed on this branch past .gitignore — consider moving it to a release attachment before merge.

🤖 Generated with Claude Code

johnpierson and others added 9 commits September 9, 2026 11:39
- Only AI-name newly created groups: recoloring an existing group no
  longer overwrites its user-authored title, and created annotations are
  resolved by id instead of Annotations.Last()
- Let the rename go through UpdateModelValueCommand alone so undo
  restores the pre-rename title, and skip it when the group was deleted,
  undone, or the workspace changed during inference
- Make the server client thread-safe: session-scoped cancellation,
  atomic Disable/startup handoff, no restart after disable, no
  UI-thread WaitForExit, and safe teardown of process and HttpClient
- Tie llama-server to the host process with a kill-on-close job object
  so crashes cannot orphan the ~2.5 GB model process
- Scope the FOCA guard to naming only so group creation keeps working
  while a suggestion is in flight
- Clamp the naming indicator to the owner's real on-screen bounds so it
  follows the cursor when Dynamo is maximized
- Dismiss progress UI before error dialogs and silence errors caused by
  turning the feature off mid-request
- Provisioning: cross-process install lock, marker invalidation before
  reinstall, stale download cleanup before the disk check, model size
  cap, and a download URL pinned to an immutable revision
- Keep Monocle loading when the local naming env vars are misconfigured
- Drop the GroupNodeSummary wrapper; prompts take node names directly

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@johnpierson
johnpierson force-pushed the codex/experiment-local-group-naming branch from ef78e4b to 0fae3b1 Compare September 9, 2026 18:30
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