Skip to content

update-issue: let the workflow fix or default the body operation (an agent that omits it silently appends a second post) #77503

Done

Description

@ekbritecore

Problem

safe-outputs.update-issue has no way for the workflow author to fix or default the body operation. The agent output's operation field is optional and the handler defaults to append (docs, "Issue Updates": "The operation field is optional (defaults to append)"). For a tracker issue that is meant to hold ONE post, rewritten in place with operation: "replace-island", this means a single omitted field by the model silently appends a second post instead.

What happened

A scheduled daily report workflow instructs the agent, in plain words, to call update_issue with operation: "replace-island". On one run the model's call carried no operation key (the staged agent_output.json item was {"type":"update_issue","output_id":"...","body":"..."}). The safe-outputs handler logged Operation: append (add to end with separator) and added a second report after the issue's footer. The next run would have replaced only the island, leaving the stray section forever. The run before logged Operation: replace-island (updating existing island for workflow ...) for the same prompt. Seen on gh-aw v1.2.0; the current docs on main describe the same default.

The prompt is not enough: the model is the only thing deciding which operation runs, for an output that is otherwise fully deterministic.

What we do today (a workaround)

A post-step rewrites every update_issue item in the staged output to replace-island. That works but it reads and rewrites the safe-output files from post-steps, which the docs say not to do (paths and format are implementation details), and it has to be staged outside the agent's writable mount to be safe.

Proposal

A frontmatter option on update-issue, for example:

safe-outputs:
  update-issue:
    body:
    operation: replace-island   # fixed: the agent's `operation` is ignored or must match

Either a fixed operation (the agent's value is ignored or rejected if different), or a default-operation used when the agent omits it. The same option would be useful for update-pull-request bodies if it has the same default. Tracker-style issues (one post, rewritten each run) are a common pattern for scheduled reports, and append and replace (which would wipe the issue header) are both the wrong outcome there.

Happy to test a fix on our workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions