Skip to content

fix(server): keep local edits when the dashboard updates an agent - #967

Merged
runkids merged 2 commits into
mainfrom
runkids/agent-update-local-edits
Nov 20, 2026
Merged

runkids merged 2 commits into
mainfrom
runkids/agent-update-local-edits

Conversation

@runkids

@runkids runkids commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

None. This is the follow-up that #966 lists under "Not covered". It is based on main and does not depend on #965 or #966.

What changed

Updating an agent from the dashboard replaced the file with the remote version even when the user had edited it since install. Skills were already protected: update skips them and offers a forced retry.

  • An agent whose file no longer matches the hash recorded at install or update time is skipped with the message a skill gets, has local changes since install (try force update). The Updates tab then offers Force Retry on the row, and the agent's own page asks before overwriting.
  • The check runs only once a newer version is about to be written. An edited agent that is already at the remote version still reports up to date, so no forced retry is offered that would change nothing.
  • Assigning targets to an agent from the dashboard rewrites its frontmatter. That rewrite now carries the recorded hash, as it does for skills, so it is not mistaken for a local edit.
  • The confirmation on the agent's page no longer lists the local changes. That list is served for skills only, and for an agent it showed a load error.
  • website/docs/reference/commands/update.md and its ja, ko, zh-Hans and zh-Hant copies describe the behaviour.

Agents inside a tracked repo are not affected: they update through the repo, which has its own check for uncommitted changes.

Screenshots

Update on writer, edited locally and behind its remote, from the Agents Updates tab: skipped, with Force retry.

Agents Updates tab: the edited agent is skipped and offers Force retry

Update from the agent's own page: it asks before overwriting.

Agent page: confirmation before overwriting local edits

Checks

  • make check in the devcontainer: passed.
  • UI: full Vitest run (1001 tests), pnpm lint (0 errors), pnpm format:check, pnpm build.
  • TestMetadataEntry_AgentLocallyModified: unchanged file, edited file, no recorded hash, missing file.
  • TestUpdateAgent_LocallyModifiedIsSkippedWithoutForce: an edited agent behind its remote is skipped and the file is kept. It failed before the fix.
  • TestUpdateAgent_LocallyModifiedAtTheRemoteVersionIsUpToDate: an edited agent at the remote version reports up to date.
  • TestHandleSetSkillTargets_KeepsLocalChangeStateOfRemoteAgent: assigning a target leaves an unedited agent unedited and an edited agent edited.
  • End to end in an ssenv with the real binary and a browser:
    • edited agent, remote unchanged: up to date, edit kept;
    • edited agent, remote newer: skipped with Force retry, edit kept;
    • the confirmation on the agent's page, then Force overwrite local edits: the agent is at the remote version;
    • a target assigned through the dashboard: skillshare check agents still reports up_to_date.
  • python3 scripts/ai-context.py check: ok.

Not run: website build. The docs change is one plain paragraph per file.

Not covered

  • An agent installed before file hashes were recorded has nothing to compare against and is still overwritten. skillshare check agents reports such an agent as local for the same reason.
  • When the remote moved but this agent's file did not change upstream, an edited agent is still skipped. The update cannot tell before fetching, and skipping is the safe side.
  • The confirmation on the agent's page does not list what would be lost; the changes endpoint serves skills only.
  • A tracked agent repo with uncommitted changes is skipped with no force button, as a tracked skills repo is.
  • The CLI's update agents is not changed.
  • The three places that rewrite a file and carry its hash repeat the same few lines; a shared helper is left for a follow-up.
  • No rendered UI test: the page change removes a list from a dialog, and the dashboard test rules keep rendered tests for writes and deletes. It was verified in the browser.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

Updating an agent from the dashboard replaced the file with the remote
version even when the user had edited it since install. Skills were already
protected: update skips them and offers a forced retry. Agents had the
recorded file hash to compare against, but the update never looked at it.

An agent whose file no longer matches its recorded hash is now skipped with
the same message as a skill, so the Updates tab offers Force Retry and the
agent's own page asks before overwriting. The check runs only once a newer
version is about to be written, so an edited agent that is already at the
remote version still reports up to date.

Assigning targets to an agent from the dashboard rewrites its frontmatter.
That rewrite now carries the recorded hash, as it does for skills, so it is
not mistaken for a local edit.

The confirmation on the agent's page no longer tries to list the local
changes: that list is served for skills only and showed a load error.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T08:57:53.534605Z 25c136f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids runkids mentioned this pull request Nov 20, 2026
6 of 9 tasks
@runkids
runkids merged commit 0cc1c25 into main Nov 20, 2026
10 checks passed
@runkids
runkids deleted the runkids/agent-update-local-edits branch November 24, 2026 11:12
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