Skip to content

fix: keep cache trimming in its own folder and tighten agent approvals - #19

Merged
nodemode-ai merged 12 commits into
mainfrom
fix/review-2026-11-28
Nov 29, 2026
Merged

nodemode-ai merged 12 commits into
mainfrom
fix/review-2026-11-28

Conversation

@gbarnai

@gbarnai gbarnai commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • A chosen cache folder now holds the media cache in a Formencoder Cache subfolder of its own, so trimming and cleaning the cache remove only cache files.
  • Callers that name themselves after the app (ui, engine, desktop, in any case or spacing) are treated as outside callers over HTTP and MCP, so preferences that only the window may change stay with the window.
  • family.add, family.addLink and family.linkFormcut, over HTTP and as the MCP family tool, now ask before they publish. Their settings, outputs and named presets count toward the approval, and so do preset files imported in the same batch.
  • The Folder publish destination numbers a copy whose name is already taken (including by a link), refuses an empty path, and asks before an agent adds one. Paths shown in an approval stay on one line.
  • queue.save counts as a change rather than a query, and saving over an existing .fequeue waits for approval. The agent references were regenerated.
  • formwav and formvis started headless get a free port and are looked for there while the process runs. An engine that never answers is stopped, and one that exits leaves no address behind.
  • Tests: backend/tests/test_agent_approvals.py, test_cache_folder.py, test_family_headless.py and test_window_prefs.py. Full backend suite: 304 passed. Window smoke: 2 passed.
  • Windows: npm style .cmd shims for agent programs are followed to the exe or node script they wrap and started directly. Any other .cmd or .bat starts through cmd.exe /d /c only with plain-text arguments; otherwise the start is refused with a clear message.
  • New query command preset.resolve returns the settings a preset command would leave without writing anything. The approval check uses it for preset create (including from an output), update, duplicate, alias and import.
  • Approval checks fail closed when a preset or preset file cannot be read.
  • queue.save takes an overwrite flag and refuses to replace an existing file without it; the window's save dialog passes it.
  • family.linkFormcut stores the resolved preset id and refuses unknown presets; formcut exports for a preset that publishes wait for approval in Agent Connect.
  • Tests: Windows start argv builder (runs on any OS) and the new approval and overwrite paths.

Tests

  • Each fix has a test that fails on the previous code where practical.
  • The repo CI commands were run locally on macOS. Every failure seen locally also fails on main in the same environment (missing local tools or platform-specific tests); none is introduced here.
  • Please rely on this PR's CI run for Linux and Windows.

For the owner

  • A few related items need an owner decision; they are listed separately, not here.

How to ship

  • Independent of other repos; merge in any order. No version bump; release as usual.

A chosen cache folder now holds the cache in a Formencoder Cache
subfolder, so trimming and cleaning remove only cache files and never
other files that live in the chosen folder.
The HTTP and MCP routes now map every name the app keeps for itself
(ui, engine, desktop) to the ordinary caller name, so preferences that
only the window may change stay with the window.
family.add, family.addLink and family.linkFormcut, over HTTP and as the
family tool, now count their settings, outputs and preset toward the
publish approval, and a preset named by a command counts its own
publish destinations, as settings given inline already did.
The folder destination numbers a copy whose name is already taken, as
outputs do while incrementNames is on, refuses an empty path instead of
copying into the working folder, and asks before an agent adds one.
queue.save writes a file, so it is no longer marked as a query: an
outside agent is asked once like any other change, and saving over an
existing .fequeue waits for approval as replacing an output does.
formwav and formvis keep no engine record, so a headless start now
gives them a free port and looks for them there, and an engine that
never answers is stopped instead of left running.
A preset file imported by an agent now counts its publish destinations
toward the approval, so importing and using it in one batch still asks.
Folder and file names shown in an approval are kept to one line, and a
folder destination numbers a copy when a link of the same name is there
instead of writing through it.
A family app started headless is looked for at its own port only while
the process is still running, and an engine that exits during start no
longer leaves its address behind.
The shared agent finder (1.0.2) follows an npm style .cmd shim to the
exe or node script it wraps and runs that with an argv list. Any other
.cmd or .bat still goes through cmd.exe /d /c, but only when every word
is free of & | < > ^ ( ) ! % " and control characters; otherwise the
start is refused with a plain message that points to standard input or
a file. Agent tabs answer the refusal as 422 and the Claude Code setup
reports it instead of failing.
- preset.resolve (a query) returns the settings preset.create (including
  fromOutput), preset.update, preset.duplicate, preset.alias and
  preset.import would leave, reading an import file the way the import
  itself does; the approval check uses it for those commands.
- A preset or preset file that cannot be read or parsed now needs the
  person's approval instead of being skipped.
- queue.save refuses an existing file unless overwrite is true; the
  approval check asks when overwrite is set, and the save dialog in the
  window passes it.
- family.linkFormcut stores the resolved preset id and refuses unknown
  presets; the formcut webhook re-checks publishing for the linked
  preset and leaves the queueing to the person's approval when needed.
- preset.resolve is now an internal engine command: it is no longer
  listed, described, put in a menu or offered as an MCP tool, and the
  engine runs it only for the engine service itself; every other caller,
  in a single call or a batch, is refused.
- It answers with a publish summary only (whether the preset publishes,
  the kinds of destination, and whether a local file is deleted), never
  the settings themselves; a file that is not a preset gets a generic
  error that does not repeat its path or contents.
- The approval check builds its reasons from that summary.
- agents sync regenerated agents/manifest.json and the harness command
  reference without preset_resolve.
- Rust and Python tests cover the refusal, the summary and the listing.
- family.resolved and publish.result move to the internal command list:
  only the engine service, which hands back family media and publish
  results, can run them; every other caller, in a single call or a
  batch, is refused.
- They are no longer listed, described, put in a menu or offered as MCP
  tools; agents sync regenerated agents/manifest.json and the harness
  command reference, and the window menu no longer needs to hide them.
- Rust and Python tests cover the refusal and the absence for all three
  internal commands.
@gbarnai
gbarnai requested a review from nodemode-ai as a code owner November 29, 2026 18:18
@nodemode-ai
nodemode-ai merged commit 0aef259 into main Nov 29, 2026
9 checks passed
@nodemode-ai
nodemode-ai deleted the fix/review-2026-11-28 branch November 29, 2026 18:57
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