You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(agents): the installer loses local work — unparseable markers are overwritten and an edited body freezes the file #3247
I searched open and closed issues and did not find a report of this problem.
I reviewed this report and removed credentials, tokens, private paths, hostnames, and other sensitive data.
Problem
The agent installer loses local work in two ways, both silent.
It overwrites a file whose managed markers cannot be parsed. An installed agent can carry user sections in <!-- gentle-ai:<name> --> blocks. The installer compares the body with those blocks removed, which works for a well-formed block — but when a marker set is unbalanced, stray, mismatched or reopened inside itself, it falls back to comparing the whole file, and a hash match then lets it rewrite the file and lose everything inside those markers.
An edited body freezes the file forever. Any body change makes the installed copy unrecognizable as a shipped version, so ownership is released and the file is never updated again — with no report. The user only finds out when the agent has drifted for weeks. A frontmatter-only edit (adding an MCP tool, changing model:) releases ownership the same way.
Related: #3097 covers the primary session dropping user policy inside an orchestrator block, which the same work addresses.
Steps to reproduce
Install the package agents, so agents/*.md exist under the agent home and are recorded as package-managed.
Break one agent's markers: write <!-- gentle-ai:note -->text with no closing marker, or a closing marker naming a different block.
Edit the same file's body outside any section, for example by adding a line of prose.
Run a forced install (a session start, or /gentle:install-<owner> --force).
Observe: in case 2 the file is rewritten from the package and the marked text is gone; in case 3 the file silently stops receiving updates.
Expected and actual behavior
Expected: a file with markers that cannot be parsed is never rewritten, and an edited body either updates while keeping the user's text or is reported. A local edit should never leave the agent silently frozen.
Actual: an unparseable marker set is rewritten from the package, and an edited body releases package ownership with nothing reported — the copy is only counted as skipped.
gentle-pi version
4.7.0 from source (installed package 4.3.0)
Pi version
1.5.2
Operating system
Linux
Relevant logs or error output (optional)
No log is produced; the failure is the absence of one. The only signal is the already present count in the install summary, which does not distinguish "unchanged" from "released because you edited it".
Activity