Skip to content

Relay request-continuation through a generated continuation workflow - #79701

Merged
pelikhan merged 5 commits into
pelikhan/verbose-waddlefrom
pelikhan/silver-parakeet
Nov 21, 2026
Merged

pelikhan merged 5 commits into
pelikhan/verbose-waddlefrom
pelikhan/silver-parakeet

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on pelikhan/verbose-waddle. The current request_continuation design has the safe-outputs job self-dispatch the workflow, which needs actions: write in an agent-adjacent job, cannot gate on human approval, and lets any aw_context forge continuation lineage. This PR moves dispatch into a generic, compiler-generated relay workflow that validates every hop and fails closed.

How it works

  1. Policy - safe-outputs.request-continuation gains continuation-policy (workflow-dispatch, or {type: workflow-dispatch, approval: <environment>}). The policy is recorded as continuation metadata in the lock file header.
  2. Request - the request_continuation handler validates the request and uploads a continuation-request-<attempt> artifact instead of dispatching. The safe-outputs job no longer needs actions: write.
  3. Conclusion - a late conclusion step dispatches agentic-continuation-relay.yml with parent_run_id / parent_run_attempt. The conclusion job gets actions: write only when the feature is enabled; dispatch is skipped when staged.
  4. Relay - .github/workflows/agentic-continuation-relay.yml is generated lazily in runPostProcessingForDirectory (like agentic-maintenance.yml) and removed when no workflow uses the feature. Jobs: resolve -> optional approve (environment gate) -> dispatch.
  5. Child - restores the checkpoint, reads hints from the parent request artifact, verifies relay lineage, and records relay_run_id in audit / logs schemas.

Relay validation (fail closed)

  • workflow_dispatch on the default branch, same repo, not a fork.
  • Every actor (actor, triggering_actor, context actor) is github-actions[bot] or a user with write/admin.
  • Parent run lineage and relay run title match.
  • Policy read from the lock at the parent head_sha and rechecked at the branch head (stricter max wins; approvals must agree).
  • depth < max; request and checkpoint artifacts exist and are unexpired.
  • Idempotent per parent attempt (relay run-name plus a marker artifact).
  • Approval environment must exist with required reviewers.
  • The child rejects lineage not created by a valid relay run (including repository_dispatch).

Other changes

  • Removed the gh-aw-durable-* concurrency group and the explicit-concurrency restriction.
  • Docs: Request Continuation (safe-outputs.md) and Durable runs (engines.md); changeset updated.
  • make recompile regenerated affected locks plus the relay.

Worth a careful look

  • Residual risk: another GITHUB_TOKEN workflow could replay a legitimate relay_run_id to start a duplicate child; it cannot forge lineage, depth, or hints.
  • Not in scope: work-queue support, relay distribution via gh aw add/init, --dir/--no-emit warnings.

Validation

  • JS: tsc clean, ESLint 0 errors, vitest 417 passed / 3 skipped across continuation, durable, and handler-manager suites.
  • Go: golangci-lint 0 issues on pkg/workflow and pkg/cli; targeted continuation/durable/concurrency tests and pkg/parser pass. Remaining full-package failures are pre-existing git-signing fixture tests.
  • make agent-report-progress: all steps pass except custom Go linters, which flag only code not touched here.

Replace the request_continuation self-dispatch with a continuation-policy
relay:

- safe-outputs.request-continuation gains continuation-policy
  ({type: workflow-dispatch, approval}); policy is recorded in lock metadata.
- The handler validates and uploads a continuation-request artifact; the
  safe-outputs job no longer needs actions: write.
- The conclusion job dispatches the lazily generated
  agentic-continuation-relay.yml with parent_run_id/attempt (actions: write
  only when the feature is enabled; suppressed when staged).
- The relay validates the dispatch (event, default branch, not a fork,
  trusted actors, parent lineage, branch-head lock policy, depth, expiry,
  idempotency), optionally gates on a protected approval environment
  (fail closed), and dispatches the child with relay_run_id lineage.
- The child restores the checkpoint, reads hints from the parent request
  artifact, verifies relay lineage, and records relay_run_id.
- Drop the durable concurrency group and the explicit-concurrency
  restriction.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@pelikhan
pelikhan marked this pull request as ready for review November 21, 2026 05:42
Copilot AI adaptive review requested due to automatic review settings November 21, 2026 05:42
@github-actions

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills...

@github-actions

Copy link
Copy Markdown
Contributor

🚀 PR Specification Reviewer has started processing this pull request

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #79701 · codex · routed: gpt61 medium · ~10 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~4 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷

@github-actions github-actions Bot 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.

What this change does: It records continuation requests and sends them through a generated relay workflow. The relay validates the request before dispatching the next run.

Should fix

  1. Reuse the default-branch lookup (actions/setup/js/dispatch_continuation_relay.cjs:22)

    • What this is: The conclusion job resolves the branch used to dispatch the relay.
    • Problem: The new getDefaultBranch helper already performs the same lookup.
    • Fix: Import that helper and remove resolveDefaultBranch.
    • If we skip it: Changes to branch resolution must be made in two places.

Verdict: Ship.
Lean: -12 lines possible.

Generated by ✂️ Ponytail Reviewer for #79701 · codex · routed: gpt61 medium · ~10 AIC · ⌖ ~1 AIC · ⊞ 185
Comment /ponytail to run again

@github-actions github-actions Bot 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.

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

Reviewed the current diff and found no actionable correctness, security, performance, or maintainability issues on changed lines. Existing review comments were empty. Static review only; tests were not run per review instructions.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (>100 new lines) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/79701-dispatch-continuations-via-generated-relay-workflow.md. Review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to the PR branch. It was generated from the PR diff.

  2. Resolve the [TODO: verify] markers in the draft: confirm the deciders, whether the second alternative was evaluated, and whether other reasons were discussed in review.

  3. Commit the finalized ADR to docs/adr/ on the branch.

  4. Reference the ADR in the PR body by adding a line such as:

    ADR: ADR-79701: Dispatch Continuations via a Generated Relay Workflow (link unavailable: invalid HTTPS URL)

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

❓ Why ADRs Matter

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context: what is the problem and what forces are at play?
  • Decision: what did you decide and why?
  • Alternatives Considered: what else could have been done?
  • Consequences: what are the trade-offs, positive and negative?

All ADRs are stored in docs/adr/ and numbered by PR number.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · routed: haiku55 xhigh · ~3 AIC · ⌖ ~2 AIC · ⊞ 8.6K · ◷
Comment /review to run again

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-7ee39e4d-3b51-4f2b-b2d8-b645cf3dbbb4","parents":[],"payload":{"id":"ldg-1bdfda2d-2f3f-42d5-9f74-c607151188ef","operation":"append","value":{"finding_count":0,"head_sha":"0cc08ff271995b86846685b1ca605bfc9e7dd8f0","outcome":"no_findings"}},"sha":"sha256:c4aae50e935f47c9910f6030983e62d887c294b3a936ba99675027ef29932c95","timestamp":"2026-11-21T05:51:34.923Z","type":"ledger_append","version":1}
History

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.

🟡 Changes recommended

Unresolved critical relay authorization and deduplication flaws can expose parent checkpoints to unauthorized children and dispatch duplicate continuation runs.

12 open issues
What changed in this PR

Moves durable continuation dispatch out of the safe-outputs job and into a compiler-generated relay, separating request recording from dispatch and adding optional human approval.

Changes:

  • Adds continuation policy, lock metadata, and a resolve/approve/dispatch relay workflow.
  • Records requests as artifacts and dispatches the relay from conclusion, removing continuation-specific write permissions from safe-outputs.
  • Updates checkpoint lineage, relay-ID data structures, tests, documentation, and generated workflows.

Verification was limited to focused, dependency-free checks; project tests and builds were not run.

File Description
schemas/​logs-jsonl.schema.json Adds the optional relay run ID field.
schemas/​audit.schema.json Adds the optional relay run ID field.
pkg/​workflow/​safe_output_handlers.go Removes continuation-specific write permissions.
pkg/​workflow/​request_continuation.go Parses policy and builds continuation metadata.
pkg/​workflow/​request_continuation_test.go Tests policy, permissions, artifacts, and staging.
pkg/​workflow/​notify_comment.go Adds conclusion-side relay dispatch and permissions.
pkg/​workflow/​lock_schema.go Defines continuation lock metadata.
pkg/​workflow/​js/​safe_outputs_tools.json Mentions optional approval in tool guidance.
pkg/​workflow/​engine_durable.go Allows explicit durable-workflow concurrency.
pkg/​workflow/​engine_durable_test.go Updates concurrency and metadata expectations.
pkg/​workflow/​continuation_relay_workflow.go Generates and removes the relay workflow.
pkg/​workflow/​continuation_relay_workflow_test.go Tests relay generation, permissions, and cleanup.
pkg/​workflow/​concurrency.go Removes automatic durable concurrency groups.
pkg/​workflow/​compiler_yaml_header.go Writes continuation policy into lock headers.
pkg/​workflow/​compiler_safe_outputs_job.go Uploads request artifacts and exposes request status.
pkg/​workflow/​compiler_orchestrator_workflow.go Updates the validation-order comment only.
pkg/​parser/​schemas/​main_workflow_schema.json Defines continuation-policy configuration.
pkg/​cli/​durable_session.go Adds relay-ID parsing, validation, and rendering.
pkg/​cli/​compile_post_processing.go Adds the relay-generation wrapper.
pkg/​cli/​compile_post_processing_work_queue_test.go Tests lazy relay generation and removal.
pkg/​cli/​compile_pipeline.go Integrates relay generation into directory post-processing.
docs/​src/​content/​docs/​reference/​safe-outputs.md Documents relay requests, approval, and recovery.
docs/​src/​content/​docs/​reference/​engines.md Updates durable-run behavior and lineage documentation.
actions/​setup/​js/​safe_outputs_tools.json Mentions optional approval in runtime tool guidance.
actions/​setup/​js/​request_continuation.test.cjs Tests artifact recording instead of direct dispatch.
actions/​setup/​js/​request_continuation.cjs Records validated continuation requests locally.
actions/​setup/​js/​durable_session.cjs Reformats prompt construction without changing behavior.
actions/​setup/​js/​durable_session_record.cjs Adds relay IDs to durable event records.
actions/​setup/​js/​durable_artifact.test.cjs Tests relay lineage, artifact hints, and restoration.
actions/​setup/​js/​durable_artifact.cjs Checks relay lineage and reads parent request hints.
actions/​setup/​js/​dispatch_continuation_relay.test.cjs Tests conclusion-side dispatch and recovery errors.
actions/​setup/​js/​dispatch_continuation_relay.cjs Dispatches the relay with parent run identity.
actions/​setup/​js/​continuation_request.cjs Adds shared artifact and lineage helpers.
actions/​setup/​js/​continuation_relay.test.cjs Tests validation, approval, dispatch, and duplicate handling.
actions/​setup/​js/​continuation_relay.cjs Implements relay validation and child dispatch.
.github/​workflows/​smoke-copilot.lock.yml Regenerates continuation metadata and relay steps.
.github/​workflows/​smoke-codex.lock.yml Regenerates relay steps and reduces safe-output permissions.
.github/​workflows/​smoke-claude.lock.yml Regenerates relay steps and reduces safe-output permissions.
.github/​workflows/​research.lock.yml Regenerates relay steps and reduces safe-output permissions.
.github/​workflows/​daily-arxiv-researcher.lock.yml Regenerates continuation metadata and relay steps.
.github/​workflows/​copilot-cli-deep-research.lock.yml Regenerates relay steps and reduces safe-output permissions.
.github/​workflows/​agentic-continuation-relay.yml Adds the generated validation, approval, and dispatch jobs.
.changeset/​request-continuation-safe-output.md Updates release notes for relay-based continuation.

Review effort: Max (adaptive)

Comment thread actions/setup/js/continuation_relay.cjs Resolved
Comment thread actions/setup/js/continuation_relay.cjs Resolved
Comment thread actions/setup/js/continuation_relay.cjs Resolved
Comment thread actions/setup/js/continuation_relay.cjs Resolved
Comment thread actions/setup/js/durable_artifact.cjs Resolved
Comment thread actions/setup/js/durable_artifact.cjs Resolved
status: data.status,
...(data.parentRunId ? { parentRunId: String(data.parentRunId) } : {}),
...(data.artifactId ? { artifactId: String(data.artifactId) } : {}),
...(data.relayRunId ? { relayRunId: String(data.relayRunId) } : {}),

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.

Added relayRunId to the collection and compaction allow-lists, with coverage that verifies it survives into the session output. Fixed in cc8ccba.

if config.Strict {
return err
}
if err := generateDirectoryCompanionWorkflows(ctx, compiler, workflowDataList, config, getAbsoluteWorkflowDir(workflowsDir, gitRoot), gitRoot); err != nil {

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.

Directory companion workflow regeneration is skipped after compile errors, preserving the existing relay until a complete successful scan. Fixed in cc8ccba.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest pelikhan/verbose-waddle using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/dispatch_continuation_relay.cjs:22): address unresolved feedback - Review comment
  3. Review (actions/setup/js/continuation_relay.cjs:141): address unresolved feedback - Review comment
  4. Review (actions/setup/js/continuation_relay.cjs:143): address unresolved feedback - Review comment
  5. Review (actions/setup/js/continuation_relay.cjs:276): address unresolved feedback - Review comment
  6. Review (actions/setup/js/continuation_relay.cjs:296): address unresolved feedback - Review comment
  7. Review (actions/setup/js/durable_artifact.cjs:151): address unresolved feedback - Review comment
  8. Review (pkg/cli/compile_pipeline.go:1120): address unresolved feedback - Review comment
  9. Review (actions/setup/js/continuation_relay.cjs:161): address unresolved feedback - Review comment
  10. Review (actions/setup/js/dispatch_continuation_relay.cjs:36): address unresolved feedback - Review comment
  11. Review (actions/setup/js/durable_artifact.cjs:144): address unresolved feedback - Review comment
  12. Review (actions/setup/js/durable_session_record.cjs:21): address unresolved feedback - Review comment
  13. Review (pkg/cli/compile_pipeline.go:1082): address unresolved feedback - Review comment
  14. Review (pkg/workflow/continuation_relay_workflow.go:160): address unresolved feedback - Review comment

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "41abf0c6311169f5e964ba086285da816f5a6c6d",
  "kind": "requested",
  "schema_version": "1",
  "state": "24fe1e97eb8b8ecdaed1c93c624d5d7bb6a7dcb050c305fe5a2b381e7692592c",
  "work": [
    "0f44f3af4e9a97ab4f78a65cb6908d7281f306abebda7045d4b5cc9c142d822b",
    "137695344334a3f41ace7d141b983d513627adc6484fa1c54f46eb2fe6886ca9",
    "239025719befed5a273ef98dfcfa7e7f438ec6ca0e13959c510726a7d3b350a5",
    "3aecfbb64c70fc6ea6c78441ba5936819978563dbb4be85a1f45feaf03d274ec",
    "40d5b10d0aec8fe8ed26a0c6e14a1faeb3ade307170c044726a32a948392ea19",
    "44a06563554a716cd9c3e1a115e033852d3c55944423a62209a6de24256d27a9",
    "57603601ac557794e0a712d043ae182959c8db01139546e43b010aae7dd0b0b6",
    "7f8f46d096c568cc2b8a82cf753a08e58ebbe5fe95edd242a35ae976d133a1ea",
    "934f08fcdd4bc37f78b902dd9b09fe118956eb63386116945ab3b30ba9e18868",
    "a8d5c7be149c51080aa8cbf8056cf90c2a106d68ab56e3df11e8acef932c42b3",
    "bd0674b6454229f5c82200d1184020baf2d228a5c960c64f876aa67bc748a027",
    "c442430ac43f25c943ebd9ebf443055b898ebd4e42438fd5fcb4cbf74950cf8d",
    "e2ac38b7cbd9955e36f9a105c1468f76b3366e1aa407b57d53b2570dd3da5c1b"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~3 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot fix ci failures

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot

  • ensure aw using engine.durable will continue to work
  • tool description should use "durable" in description.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

The requested base is already an ancestor; make merge-main targets main, not the stacked base. The linked review comments were addressed and replied to in cc8ccba.

@copilot fix ci failures

In 619fa2b1, increased the failing connector test’s timeout; it passed five local runs. CI’s sanitized error does not confirm the cause. The final gate passed impacted tests and Go lint but failed on existing custom-linter findings in other files.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@pelikhan
pelikhan merged commit 197f2cc into pelikhan/verbose-waddle Nov 21, 2026
105 checks passed
@pelikhan
pelikhan deleted the pelikhan/silver-parakeet branch November 21, 2026 16:36

Copilot AI commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

@copilot

  • ensure aw using engine.durable will continue to work
  • tool description should use "durable" in description.

Added legacy engine.durable compilation and relay-generation regression coverage, and described the tool as a durable continuation in 003d2b91. Focused tests pass; the final gate still reports the previously noted custom-linter findings in other files.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants