Skip to content

Release 1.2.2#41

Merged
ojowwalker77 merged 15 commits into
mainfrom
release-1.2.2
Jul 1, 2026
Merged

Release 1.2.2#41
ojowwalker77 merged 15 commits into
mainfrom
release-1.2.2

Conversation

@ojowwalker77

Copy link
Copy Markdown
Owner

Release 1.2.2. Rolls up everything on release-1.2.2 on top of the current main (1.2.1), and moves the Unreleased notes into a dated [1.2.2] changelog section.

Added

  • Agent skills for any coding agent. The canvas API (127.0.0.1:7337) now ships a portable skill doc, not just a Claude Code skill. On first launch, if Claude Code, Codex CLI, and/or Cursor are detected, BonsAI offers to install the matching doc into each one's own config location. Reinstall or add more anytime in Settings ▸ Connectors ▸ Agent Skills.
  • Model pickers for the agent chat and board description. Choose the Claude model each runs on (Opus / Sonnet / Haiku), from the Agent panel header and Settings ▸ Runtime ▸ Models. Chat defaults to Opus, describe to Sonnet; passed through as claude --model.

Fixed

  • Board edits made right before quit are no longer lost. The ~400ms autosave debounce could drop an edit that landed just before the app closed (including a delete/add_text op from an external agent over the canvas API). BonsAI now flushes the pending save on termination, and reroutes a bare SIGTERM (e.g. pkill from the dev-loop relaunch script) through the normal quit path so the flush still runs.
  • Image selection ring no longer double-borders. The accent selection ring now hugs an image card's own edge instead of sitting a few pixels outside it as a second, gapped border.

Notes

  • main was merged into release-1.2.2 first, so this PR also carries the 1.2.1 Shift+Enter select-all follow-up fix that release-1.2.2 was missing, and the CHANGELOG conflict is already resolved — the diff here is only the 1.2.2 delta.
  • Verified locally: swift build clean, swift test green (37 tests).

Add a per-surface Claude model choice, passed to `claude --model`:
- Chat (CanvasAgent) defaults to Opus; picker in the Agent panel header.
- Describe board (HeadlessPromptService.describeBoard) defaults to Sonnet.
Both bind one UserDefaults key each (ModelPreferences), so the Agent-dock
picker and the Settings > Runtime > Models pickers mirror live. The rawValue
is the CLI alias (opus/sonnet/haiku) so the CLI resolves the latest in-tier.
Refine and Compile stay on the CLI default.
…and Cursor

The bonsai-board skill previously only existed as a local Claude Code skill
file living outside the repo. Bundle the canvas API doc for three agents and
offer to install it on first launch (only for agents detected on the Mac),
with a reinstall/install-more control in Settings > Connectors > Agent Skills.

Claude Code and Cursor get a dedicated file; Codex's AGENTS.md is shared with
the user's own notes, so it's merged into a marked section instead of
overwritten.
DumpStore debounces saves 0.4s after each edit, but AppDelegate never
flushed the pending save before exit. A board mutation (including one
from an external agent over the canvas API) made within that window
was silently lost on quit.

Wires up the already-existing-but-unused BoardViewModel.flushSave()
via CanvasBridge on applicationWillTerminate, and also translates a
bare SIGTERM (e.g. pkill, used by the dev-loop relaunch script) into
the normal NSApp.terminate path, since a raw SIGTERM otherwise
bypasses AppKit's termination delegate entirely and would never flush.
An image card renders its own rounded border. The accent selection ring was
drawn `selectionGap` px outside at a larger corner radius, so selecting an image
showed two concentric rounded borders with a visible gap. For image cards the
ring now hugs the image's own edge (tight gap, matching radius, slightly heavier
stroke) as a single clean accent outline. Text, shapes, and lines are unchanged.
Resolve conflict in AppDelegate.swift: keep both the agent-skills first-launch prompt (this PR) and the SIGTERM handler (release-1.2.2) — independent additions.
feat(agent-skills): install canvas-API skill for Claude Code, Codex, and Cursor
Brings in the 1.2.1 changelog + Shift+Enter select-all follow-up fix from main, and rolls the release-1.2.2 Unreleased notes into a [1.2.2] section (agent skills, model pickers, autosave-flush-on-quit, image selection ring).
@github-actions github-actions Bot added size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jul 1, 2026
…ring hugs the image

Dropped images were created at a fixed 220x140 landscape frame while the image drew with scaledToFill and no frame clamp, so non-landscape images overflowed the card — the selection ring hugged the frame while the image spilled past it. Size the card to the image's pixel aspect ratio on drop, clamp the image to the frame so it fills-and-crops instead of overflowing, and align the image ring corner radius (10->8) to the image's own border.
…bundle; don't clobber an unreadable AGENTS.md

.process("Resources") flattens the bundle tree, so the subdirectory: "AgentSkills" lookup always returned nil and every install failed. Try the no-subdirectory form first (as EngineLogo does), with the subdirectory as fallback. Also: mergeMarkedSection mapped any read failure to "" via try?, so an existing-but-unreadable AGENTS.md would be overwritten with only BonsAI's section — now only a genuinely-absent file is treated as empty; a real read error propagates.
…the image

On Copy/Compile an image card now serializes to its absolute file path instead of contributing nothing (or only OCR text) — so the reference is pasteable and a board that's just an image no longer copies as empty. Describe passes the image path through the board-state JSON and grants `claude -p` the read-only Read tool (--allowedTools Read) so the model opens and views the actual image.
…against reversed markers

The Settings > Runtime > Models 'Describe board' picker sets a claude --model alias, so it silently no-op'd when preferredEngine() resolved to Codex (Claude disabled/unavailable). It now disables with an explanatory note whenever Claude isn't the engine that will run Describe. Also harden AgentSkillsInstaller.mergeMarkedSection: if a file's end marker precedes its begin marker, append a fresh section instead of trapping on a reversed replaceSubrange range.

@ojowwalker77 ojowwalker77 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

CHANGES REQUESTED: 2 must-fix issues. I reviewed PR #41 against main: the agent skill installer, model/describe runtime path, autosave-on-termination, canvas/image polish, and release changelog. SCIP is unavailable for this Swift repo, so blast radius is heuristic plus direct call-site reads and cold sub-agent slices; the Splus audit is clean (42/42 changed exports interrogated, no floor findings unaccounted).

flowchart LR
  Board["Board state + user/agent text"] --> Describe["HeadlessPromptService.describeBoard"]
  Describe --> ClaudeRead["Claude --allowedTools Read"]
  Installer["AgentSkillsInstaller"] --> CodexAgents["~/.codex/AGENTS.md"]
  ChangeLog["CHANGELOG.md"] --> Release["1.2.2 release notes"]
Loading

The blockers are broad local file read permission in Describe and unsafe marker replacement in the shared Codex instructions file. I also left two smaller correctness concerns around installed-status detection and the malformed 1.2.1 changelog entry.

Comment thread Sources/ComposerApp/Services/HeadlessPromptService.swift Outdated
Comment thread Sources/ComposerApp/Services/AgentSkillsInstaller.swift Outdated
Comment thread Sources/ComposerApp/Services/AgentSkillsInstaller.swift Outdated
Comment thread CHANGELOG.md Outdated
@ojowwalker77 ojowwalker77 merged commit 2bae9eb into main Jul 1, 2026
8 checks passed
@ojowwalker77 ojowwalker77 deleted the release-1.2.2 branch July 1, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant