Skip to content

Add schedule_manually to update_work_package (pin dates against relations) #10

Description

@AndreaV-Lsi

Problem

update_work_package can set dates, but on an auto-scheduled work package with predecessors,
OpenProject rejects a date earlier than the relations allow:

422 "Finish date can only be set to … or later so as not to violate the work package's relationships."

There's currently no way via the MCP to switch a work package to manual scheduling, so an
integration can't pin a milestone/target date that intentionally differs from the dependency-derived
schedule while keeping the dependency links.

Scope

  • Add an optional schedule_manually: bool parameter to update_work_package.
  • Map it to the OpenProject scheduleManually property in the client PATCH (alongside the existing
    lockVersion + date fields, in a single request).
  • No change to create_work_package; no unrelated reformatting.

Acceptance criteria

  • update_work_package(id, schedule_manually=True, due_date=…) sets scheduleManually and the
    date in one PATCH (so the date is accepted despite the relation).
  • Omitting schedule_manually is a no-op (field not sent).
  • schedule_manually=False switches the work package back to automatic scheduling (the value is
    sent, not dropped).
  • Network-free unit tests cover tool→data passthrough, omission, and client→scheduleManually
    mapping (with lockVersion).
  • uv run black . && uv run flake8 . clean; README update_work_package entry lists the new param.

Out of scope

  • create_work_package changes; scheduling-mode changes beyond this one flag; any reformatting of
    unrelated code.

Notes

  • Depends on Make wrapped Pydantic input tools robust to MCP clients that serialize object args as JSON strings #1 / PR-4 (the flatten): the parameter is added as a flat Annotated[...] argument,
    which only exists after update_work_package was flattened. Branch feature/manual-scheduling is
    therefore stacked on fix/input-arg-serialization; its upstream PR must wait until PR-4 merges,
    then rebase onto the updated main.
  • Implemented initially out-of-process by a Cowork session; this issue retro-fits it into the
    discuss → issue → develop workflow. Label: backlog.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogLogged future work item, not yet scheduled

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions