Skip to content

Harden Daily Ambient Context Optimizer issue publication against placeholder and oversize payload failures#40508

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-daily-ambient-context-optimizer
Jun 20, 2026
Merged

Harden Daily Ambient Context Optimizer issue publication against placeholder and oversize payload failures#40508
pelikhan merged 2 commits into
mainfrom
copilot/fix-daily-ambient-context-optimizer

Conversation

Copilot AI commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Daily Ambient Context Optimizer could enter a dead-end failure path by calling create_issue with a placeholder body first, then attempting a payload above the safe-output 10KB limit. This change tightens prompt constraints and allows bounded retries so a single invalid call does not consume the workflow’s only issue-creation attempt.

  • Failure-mode hardening

    • Increased safe-outputs.create-issue.max from 1 to 3 for this workflow so invalid first attempts do not block recovery.
    • Preserves the workflow contract of producing one real report while tolerating transient tool-call mistakes.
  • Prompt guardrails for issue creation

    • Added explicit prohibition on placeholder/probe/test create_issue calls (e.g. ".", "test").
    • Added explicit sequencing rule: call create_issue only after validating final body content and length.
  • Body-size control + retry behavior

    • Added a concrete size target (< 9500 UTF-8 bytes) before submission to stay below safe-output limits.
    • Added fallback guidance: if body-size validation fails, retry with a compact body that preserves core sections (Executive Summary, Highest-Leverage Changes, Key Metrics, References).
safe-outputs:
  create-issue:
    max: 3

# prompt guardrails
- Keep the final issue body under 9500 bytes (UTF-8)...
- Never call `create_issue` with placeholders...
- Call `create_issue` only after validating your final body length and content.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incomplete result in daily ambient context optimizer Harden Daily Ambient Context Optimizer issue publication against placeholder and oversize payload failures Jun 20, 2026
Copilot AI requested a review from pelikhan June 20, 2026 20:58
@github-actions

Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — thanks for hardening the Daily Ambient Context Optimizer against placeholder calls and oversized payloads. The three-pronged approach (retry budget, prompt guardrails, and body-size target) is well-reasoned and the PR description clearly documents the failure mode being addressed.

One thing that would strengthen this further:

  • Test coverage — there are no changes to test files alongside the prompt/safe-output config changes. Even for workflow prompt files, a lightweight integration test or a snapshot assertion on the rendered safe-outputs config (e.g. asserting max: 3 and the new prompt lines appear in the compiled workflow) would give the team confidence this doesn't regress. Check whether the repo's test suite has a pattern for locking or snapshotting workflow configs.

If you'd like a hand adding coverage, you can assign this prompt to your coding agent:

Add a test (or update the existing snapshot/lock test) for the daily-ambient-context-optimizer workflow to assert:
1. The safe-outputs config for `create_issue` has `max: 3`.
2. The compiled prompt includes the guardrail lines: 'Never call `create_issue` with placeholders' and 'Keep the final issue body under 9500 bytes'.
3. The fallback retry instruction ('shorten the details and retry') is present in the workflow body.
Use whatever test pattern already exists in the repo for compiled workflow validation.

Generated by ✅ Contribution Check · 153 AIC · ⌖ 7.31 AIC · ⊞ 5.9K ·

@pelikhan pelikhan marked this pull request as ready for review June 20, 2026 21:40
Copilot AI review requested due to automatic review settings June 20, 2026 21:40
@pelikhan pelikhan merged commit 288212a into main Jun 20, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/fix-daily-ambient-context-optimizer branch June 20, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the Daily Ambient Context Optimizer workflow’s issue-publication path so that placeholder/invalid create_issue calls and oversize bodies don’t trap the run in a dead-end failure (while still producing exactly one real report).

Changes:

  • Increased safe-outputs.create-issue.max from 1 → 3 to permit bounded retries after invalid issue-creation attempts.
  • Tightened prompt guardrails to forbid placeholder/probe create_issue calls and to require validating final body content + size (targeting < 9500 UTF-8 bytes) before submission.
  • Added explicit retry guidance for body-size validation failures (shorten and retry with a compact, section-preserving report).
Show a summary per file
File Description
.github/workflows/daily-ambient-context-optimizer.md Updates safe-output allowance and strengthens prompt sequencing/size/retry guardrails for create_issue.
.github/workflows/daily-ambient-context-optimizer.lock.yml Recompiled workflow output reflecting the updated safe-output constraints and prompt content.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines +209 to +210
- Never call `create_issue` with placeholders, probes, or test strings (for example `"."` or `"test"`). Call it only with the final intended title/body.
- Call `create_issue` only after validating your final body length and content.
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.

3 participants