Skip to content

Bug: project-agent app saves ignore the version precondition and overwrite concurrent edits #3598

Closed

Description

@yannickmonney

Reproduced locally on 44e0dcf254975286c0e9dea443b5cd1ca6b23347 with real services. No production testing.

updateProjectAgent owns a PROJECT_AGENT_STALE guard and REST forwards expectedUpdatedAt. The app route validates with projectAgentInputSchema, which does not declare that field and silently strips it; the app dialog also never sends the stamp. A stale full-form save overwrites newer names/instructions/equipment.

Steps:

  1. Create a local project agent, read its config and updatedAt as writer B snapshot.
  2. Writer A changes the name using REST PUT with that current expectedUpdatedAt; it succeeds.
  3. Send B old full config plus an instruction edit and the old expectedUpdatedAt to REST PUT: 409 PROJECT_AGENT_STALE (control).
  4. Send the exact same stale config/stamp to POST /api/app/projects/agents/: 200.
  5. Read back agent: writer A newer name has reverted to B old name, while B instructions changed.

Expected: The app must carry the read version and forward it through schema validation; stale full replacements should be refused with a recoverable reload/merge path as REST already does.

Actual: The app strips a supplied precondition and silently clobbers a committed newer configuration.

Source:

Evidence: local/project-agent-precondition.py, local/project-agent-precondition-results.json

Dedup: GitHub expectedUpdatedAt search returned no issue; agent concurrent configuration returned unrelated 152. Open agent PRs 3575/3577/3579/3569 cover other concerns.

Limits: Two sequential snapshots model two open editors against real local services. No sandbox run started; provider was a local mock and no secrets granted.

Acceptance:

  • App agent editor sends expectedUpdatedAt and app route preserves/validates it.
  • A stale app save returns PROJECT_AGENT_STALE without changing config, and the editor retains unsaved edits.
  • An unchanged replacement stays idempotent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions