Repository navigation
Enable request-continuation signals and audit/logs/health analytics - #79834
Conversation
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Specification Reviewer completed successfully!
|
|
✅ Ponytail Reviewer completed successfully!
|
This comment has been minimized.
This comment has been minimized.
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: 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.
|
|
✅ PR Code Quality Reviewer completed the code quality review. Caution agentic threat detected DetailsPotential security threats were detected in the agent output. Detected threat types: prompt injection. Review the workflow run logs for details. PR Code Quality ReviewerOutcome: 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.
|
There was a problem hiding this comment.
What this change does: It adds opt-in continuation requests and reports them in audit, logs, and health.
Should fix
- Remove the unused count from
WorkflowRunand its assignments. Reports already calculate it from the request list, so this duplicate cached value adds maintenance work.
Verdict: Ship after removing the duplicate count.
Lean: -5 lines possible.
Generated by ✂️ Ponytail Reviewer for #79834 · codex · routed: gpt61 medium · ~13 AIC · ⌖ ~1 AIC · ⊞ 185
Comment /ponytail to run again
| MissingToolCount int | ||
| MissingDataCount int | ||
| NoopCount int | ||
| ContinuationRequestCount int `json:"continuation_request_count,omitempty"` |
There was a problem hiding this comment.
✂️ Remove this duplicate count and its four assignments: no code reads the WorkflowRun field, while logs, audit, and health already derive counts from ContinuationRequests; keeping both adds cached state to maintain without changing those reports.
There was a problem hiding this comment.
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 changed lines in the pre-fetched diff. I found no actionable correctness, performance, or maintainability issues to block this PR. The specialist pass was unavailable because its tool access was denied; this review is based on independent static analysis of the diff and selected source files, without executing tests or code.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again
🏗️ Design Decision Gate — ADR RequiredThis PR adds 1,121 new lines in business-logic directories (threshold: 100) and has no 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate re-runs and verifies that the implementation matches the decision. 🔍 Decision inferred from PR evidence
📋 Michael Nygard ADR Format ReferenceAn ADR must contain Context, Decision, Alternatives Considered, and Consequences. The draft includes all four. ADRs are stored in
|
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
Overview
Reviewed PR head 484e0d4472d944512a20b9e1b5ac35edc59acb21 against the Safe Outputs Gateway contract.
Key finding
The PR intentionally added request_continuation in implementation, schemas, workflows, and reference documentation, but the normative safe-outputs specification still omitted the type from its handler cross-reference and §7 definitions. This left the formal contract stale.
Synchronization
Queued commit 9f5f50fed2f777d3cbfcd536bc9dc741d5cacbcd on the same-repository PR branch. It updates docs/src/content/docs/specs/safe-outputs-specification.md to version 1.32.0, documenting the opt-in type, required nonblank message, default max: 1, metadata-only/no-API/no-mutation semantics, dependency prohibition, and unavailable-versus-zero analytics.
Coverage
Static review only; no tests or conformance scripts were run, per review contract. Existing PR tests and generated schemas were treated as evidence.
References:
Generated by PR Specification Reviewer for #79834 · copilot · gpt50 · ~8 AIC · ⌖ ~2 AIC · ⊞ 1.7K
Comment /review-specs to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd (with /grill-with-docs for the docs claim). The design is sound: request_continuation is metadata-only, never terminal, and never counts as Claim completion. Three behavior changes outside that design lack test coverage, so I left comments rather than requesting changes.
📋 Key Themes & Highlights
Key Themes
- Untested classification changes:
handle_noop_message.cjsandhandle_agent_failure.cjsnow treatrequest_continuationlikereport_incomplete. Neither has a test for it, and the docs say requests are excluded "like noop". - Availability rule: one typeless item in
safe_output.jsonlmakes the whole continuation countnull.
Positive Highlights
- ✅ Clear unavailable-versus-zero semantics in analytics (
nullfor missing evidence, never a silent zero). - ✅ Max enforcement and empty-message rejection are covered by
request_continuation_handler.test.cjs. - ✅ Health output keeps Actions conclusions separate from cached request evidence.
Scope note
The diff was read in full (2951 lines, below the 3000-line cap). Skill selection came from pr-triage.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~22 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| const agentConclusion = process.env.GH_AW_AGENT_CONCLUSION || ""; | ||
| const hasIncompleteReport = result.items.some(/** @param {any} item */ item => item.type === "report_incomplete") && !shouldIgnoreTaskCompleteRegistrationReports(result.items); | ||
| const hasIncompleteReport = | ||
| result.items.some(/** @param {any} item */ item => item.type === "request_continuation") || |
There was a problem hiding this comment.
[/tdd] request_continuation now sets hasIncompleteReport, so a run with a no-op plus a continuation request is classified incomplete and posted to the No-Op Runs issue. No test covers this path. Add a case to handle_noop_message.test.cjs that pins the intended category.
💡 Why this matters
The docs say requests are excluded from notifications "like noop", but this branch makes them count as incomplete work. Decide which is intended and make the test and docs agree.
@copilot please address this.
| hasOnlyNoopOutputs = true; | ||
| core.info("Agent failed with exit code 1 but produced only noop outputs - treating as successful no-action (transient AI model error)"); | ||
| } else if (!nonNoopItems.some(item => item.type === "report_incomplete" && !isTaskCompleteRegistrationIssue(item))) { | ||
| } else if (!nonNoopItems.some(item => item.type === "request_continuation" || (item.type === "report_incomplete" && !isTaskCompleteRegistrationIssue(item)))) { |
There was a problem hiding this comment.
[/tdd] A non-zero exit whose outputs include request_continuation now skips the terminal_reason: completed recovery path and can report a failure issue. This is a behavior change in handle_agent_failure with no test coverage. Add a test that fixes the expected outcome for a failed run that also requested continuation.
💡 Suggested test
Cover two cases: request_continuation plus a non-zero exit with terminal_reason: completed (expect no failure issue if recovery is intended), and the same without that marker (expect a failure issue).
@copilot please address this.
| Timestamp string `json:"timestamp"` | ||
| } | ||
| available := forEachSafeOutputItem(runDir, run, verbose, func(item requestItem) { | ||
| if item.Type == "" { |
There was a problem hiding this comment.
[/tdd] An item with an empty type sets invalidRequest, which makes the whole run's continuation count unavailable (null). One unrelated malformed entry therefore hides a valid request. Confirm this is intended, and add a test where a valid request_continuation sits beside a typeless item.
💡 Suggested test
Assert the expected count (or unavailable state) for a safe_output.jsonl with one valid request_continuation and one {} entry, using the same table-driven style as the existing logs_metrics tests.
@copilot please address this.
Comment MemoryPeek at saved memory (spec-review-history)History |
|
@copilot run pr-finisher skill |
There was a problem hiding this comment.
🟡 Changes recommended
Ordinary continuation requests bypass explicitly configured authorization, while unresolved evidence-handling defects can suppress or misattribute requests in logs and audits.
10 open issues
Enforce configured authorization for ordinary continuation requests · New Persist trusted continuation recording timestamps · New Accept resolved integer strings for continuation limits · New Fetch missing agent evidence before reusing audit summaries · New Refresh cached audits with continuation evidence · New Verify artifact identity and attempt before backfilling evidence · New Extract continuation requests from collected artifacts · New Keep continuation summaries after TSV headers and run rows · New Validate payload fields only for continuation output items · New Advertise the continuation tool in generated safe-output prompts · New
What changed in this PR
Adds opt-in continuation requests to gh-aw’s safe-output pipeline and analytics. Requests record remaining work without introducing automatic reruns or treating the task as complete.
Changes:
- Adds bounded
request_continuationconfiguration, validation, and runtime handling. - Extends
audit,logs, and cachedhealthreporting with request counts, provenance, and evidence availability. - Enables three workflows and updates compiled locks, documentation, and tests.
| File | Description |
|---|---|
schemas/logs.schema.json |
Defines request records and aggregate counts. |
schemas/logs-jsonl.schema.json |
Adds request fields to JSONL records. |
schemas/audit.schema.json |
Defines audit request evidence. |
pkg/workflow/work_queue_memory.go |
Reserves the continuation tool name. |
pkg/workflow/safe_outputs_validation_config.go |
Defines message validation and default limit. |
pkg/workflow/safe_outputs_tools.go |
Classifies continuation as an internal tool. |
pkg/workflow/safe_outputs_tools_computation.go |
Enables the configured continuation tool. |
pkg/workflow/safe_outputs_state.go |
Includes continuation in enabled-output detection. |
pkg/workflow/safe_outputs_max_validation.go |
Validates positive request limits. |
pkg/workflow/safe_outputs_handler_registry_test.go |
Updates diagnostic registry expectations. |
pkg/workflow/safe_outputs_handler_registry_diagnostics.go |
Builds continuation handler configuration. |
pkg/workflow/safe_outputs_config_types.go |
Adds the continuation configuration field. |
pkg/workflow/safe_outputs_config_extraction.go |
Extracts opt-in continuation configuration. |
pkg/workflow/safe_output_handlers.go |
Registers the built-in continuation descriptor. |
pkg/workflow/request_continuation.go |
Parses continuation configuration and defaults. |
pkg/workflow/request_continuation_test.go |
Tests compilation, imports, and configuration. |
pkg/workflow/notify_comment.go |
Adds conclusion-time request recording. |
pkg/workflow/notify_comment_conclusion_helpers.go |
Generates the recording step. |
pkg/workflow/js/safe_outputs_tools.json |
Adds the compiler’s continuation tool schema. |
pkg/parser/schemas/main_workflow_schema.json |
Allows continuation frontmatter configuration. |
pkg/parser/schema_request_continuation_test.go |
Tests accepted and rejected configuration. |
pkg/cli/outcome_eval.go |
Excludes requests from outcome evaluation. |
pkg/cli/outcome_eval_test.go |
Tests metadata-only outcome exclusions. |
pkg/cli/mcp_tools_privileged.go |
Documents request evidence in audit output. |
pkg/cli/mcp_tools_health.go |
Documents cached continuation health semantics. |
pkg/cli/logs_run_summary.go |
Carries requests into saved summaries. |
pkg/cli/logs_run_cache.go |
Backfills cached request evidence. |
pkg/cli/logs_run_analysis.go |
Extracts requests during run analysis. |
pkg/cli/logs_report.go |
Adds per-run and aggregate reporting. |
pkg/cli/logs_orchestrator_render.go |
Updates internal request counts. |
pkg/cli/logs_orchestrator_filters.go |
Carries requests into processed runs. |
pkg/cli/logs_models.go |
Adds request records and analysis fields. |
pkg/cli/logs_metrics.go |
Extracts requests and checks evidence completeness. |
pkg/cli/logs_format_tsv.go |
Adds continuation summaries to TSV output. |
pkg/cli/logs_format_compact.go |
Adds compact summaries and request details. |
pkg/cli/logs_episode_retrieval_artifacts.go |
Carries request fields into episode runs. |
pkg/cli/logs_cached_json.go |
Backfills JSONL-backed run evidence. |
pkg/cli/health_revisions.go |
Applies continuation analytics to current revisions. |
pkg/cli/health_metrics.go |
Adds continuation health report storage. |
pkg/cli/health_durable.go |
Includes continuation evidence in health rendering. |
pkg/cli/health_continuation_requests.go |
Aggregates and renders cached request evidence. |
pkg/cli/drain3_integration.go |
Emits requests as tool-result events. |
pkg/cli/continuation_requests.go |
Adds shared counting, backfill, and rendering helpers. |
pkg/cli/continuation_requests_test.go |
Tests extraction, caching, analytics, and serialization. |
pkg/cli/audit.go |
Adds request storage to analysis results. |
pkg/cli/audit_summary_build.go |
Carries requests into audit summaries. |
pkg/cli/audit_run_pipeline.go |
Backfills requests from cached artifacts. |
pkg/cli/audit_report.go |
Includes requests in assembled audits. |
pkg/cli/audit_report_types.go |
Adds the audit request field. |
pkg/cli/audit_report_render.go |
Displays requests and evidence availability. |
pkg/cli/audit_expanded.go |
Adds request counts to session analysis. |
pkg/cli/audit_analysis_fanout.go |
Runs continuation extraction alongside other analyses. |
docs/src/content/docs/reference/safe-outputs.md |
Documents configuration, semantics, and analytics. |
actions/setup/js/work_queue_delivery.test.cjs |
Tests that requests cannot establish Claim completion. |
actions/setup/js/work_queue_delivery.cjs |
Prevents requests from verifying Claim completion. |
actions/setup/js/types/safe-outputs.d.ts |
Adds the continuation item type. |
actions/setup/js/safeoutputs_cli.cjs |
Classifies requests as non-terminal diagnostics. |
actions/setup/js/safe_outputs_tools.json |
Adds the runtime continuation tool schema. |
actions/setup/js/safe_output_submission.test.cjs |
Updates dependency restriction expectations. |
actions/setup/js/safe_output_submission.cjs |
Excludes requests from dependency participation. |
actions/setup/js/safe_output_manifest.cjs |
Excludes requests from mutation manifests. |
actions/setup/js/safe_output_handler_manager.cjs |
Routes standalone and Claim-scoped requests. |
actions/setup/js/request_continuation_handler.test.cjs |
Tests validation, limits, and diagnostic semantics. |
actions/setup/js/request_continuation_handler.cjs |
Implements bounded metadata-only handling. |
actions/setup/js/record_request_continuation.cjs |
Records ordinary requests during conclusion. |
actions/setup/js/pi_tool_policy.cjs |
Restricts child-agent continuation reporting. |
actions/setup/js/log_parser_shared.test.cjs |
Tests continuation preview formatting. |
actions/setup/js/load_agent_output.cjs |
Recognizes continuation as diagnostic output. |
actions/setup/js/handle_noop_message.cjs |
Prevents requests from implying completed no-action. |
actions/setup/js/handle_agent_failure.cjs |
Preserves failure handling when continuation is requested. |
.github/workflows/spec-extractor.md |
Enables requests for unfinished extraction work. |
.github/workflows/spec-extractor.lock.yml |
Compiles extractor configuration and recording step. |
.github/workflows/mattpocock-skills-reviewer.md |
Enables requests for unfinished review work. |
.github/workflows/mattpocock-skills-reviewer.lock.yml |
Compiles reviewer configuration and recording step. |
.github/workflows/contribution-check.md |
Enables requests for unfinished evaluation work. |
.github/workflows/contribution-check.lock.yml |
Compiles contribution configuration and recording step. |
Review effort: Max (adaptive)
| const messageHandler = messageHandlers.get(messageType); | ||
| // Ordinary continuation requests are recorded once in conclusion; Claims | ||
| // retain their scoped diagnostic handler rather than an anonymous replay. | ||
| const messageHandler = messageType === "request_continuation" && !currentClaimHandle() ? undefined : messageHandlers.get(messageType); |
| } | ||
|
|
||
| func processedRunFromSummary(summary *RunSummary, runOutputDir string) ProcessedRun { | ||
| backfillContinuationRequests(&summary.ContinuationRequests, summary.Run, runOutputDir, false) |
| func processedRunFromCachedData(data RunData, audit *AuditData, outputDir string) ProcessedRun { | ||
| run := WorkflowRun{DatabaseID: data.RunID, WorkflowName: data.WorkflowName} | ||
| runDir := filepath.Join(outputDir, fmt.Sprintf("run-%d", data.RunID)) | ||
| backfillContinuationRequests(&data.ContinuationRequests, run, runDir, false) |
| if data.SafeOutputs.RequestContinuation != nil { | ||
| enabledTools["request_continuation"] = struct{}{} | ||
| } |
There was a problem hiding this comment.
💥 [THE END] — Illustrated by Smoke Claude · claude · sonnet46 · ~71 AIC · ⌖ ~9 AIC · ⊞ 1K
Comment /smoke-claude to run again
| allowed-repos: all | ||
| min-integrity: none | ||
| safe-outputs: | ||
| request-continuation: |
There was a problem hiding this comment.
✅ Good addition! The request-continuation safe output with max: 1 is a clean way to signal that more work remains without accidentally spamming the queue. Consider adding a comment in the workflow body explaining when to use request_continuation vs report_incomplete for clarity.
| const allNoopItems = (result.items || []).filter(/** @param {any} item */ item => item.type === "noop"); | ||
| const noopItems = limitedMaxCount > 0 ? allNoopItems.slice(0, limitedMaxCount) : allNoopItems; | ||
| const nonNoopItems = result.items.filter(/** @param {any} item */ ({ type }) => type !== "noop"); | ||
| const nonNoopItems = result.items.filter(/** @param {any} item */ ({ type }) => type !== "noop" && type !== "request_continuation"); |
There was a problem hiding this comment.
Nice fix! Filtering out request_continuation items alongside noop items ensures they are not counted as failures or unexpected output. The pattern type !== "noop" && type !== "request_continuation" is clear. Worth extracting these type constants into a shared enum or object if more types are added in the future.
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved defects in continuation-request evidence, caching, and completion checks can produce missing timestamps, inaccurate counts, stale rerun data, and suppressed failure diagnostics.
11 open issues
Enforce configured authorization for ordinary continuation requests Persist stamped timestamps where audit and logs can read them · New Exclude continuation requests from completion evidence · New Cache completed unsuccessful artifact lookups · New Read experiment assignment from the usage collection fallback · New Deduplicate mirrored requests by submission identity, not contents · New Do not treat placeholder empty arrays as complete evidence · New Reject stale request metadata from prior run attempts · New Advertise the continuation tool in generated safe-output prompts Verify artifact identity and attempt before backfilling evidence Refresh cached audits with continuation evidence
6 resolved since last review
Validate payload fields only for continuation output items Keep continuation summaries after TSV headers and run rows Extract continuation requests from collected artifacts Fetch missing agent evidence before reusing audit summaries Accept resolved integer strings for continuation limits Persist trusted continuation recording timestamps
Review effort: Max (adaptive)
| } | ||
| } | ||
| } | ||
| if (changed) fs.writeFileSync(outputPath, JSON.stringify(sourceOutput)); |
| // Types in this set are excluded by the catch-all fallthrough; opt-in checks for | ||
| // report_missing_data/report_incomplete must run before that fallthrough. | ||
| const NON_TERMINAL_SAFE_OUTPUT_TYPES = new Set(["report_missing_tool", "report_missing_data", "report_incomplete"]); | ||
| const NON_TERMINAL_SAFE_OUTPUT_TYPES = new Set(["report_missing_tool", "report_missing_data", "report_incomplete", "request_continuation"]); |
| if auditNeedsContinuationAgentOutput(cfg) { | ||
| auditLog.Printf("Cache miss for run %d continuation requests: requested agent output is not present locally, bypassing cache", cfg.runID) | ||
| if err := invalidateAgentOutputDownloadMarkers(cfg.outputDir); err != nil { | ||
| return false, false, err | ||
| } | ||
| return false, false, nil |
| continue | ||
| } | ||
| foundOutput = true | ||
| experiment, variant, _ := firstExperimentAssignment(extractExperimentData(dir)) |
| if _, exists := seen[request]; exists { | ||
| continue | ||
| } | ||
| seen[request] = struct{}{} |
| if safeOutput.Items == nil { | ||
| return false | ||
| } | ||
|
|
||
| validItems := len(safeOutput.Errors) == 0 |
| activitySummaryApplied := backfillCacheHitIfNeeded(&result, runOutputDir, params.verbose) | ||
| steeringBackfillApplied := backfillGatewaySteeringEventsIfNeeded(&result, runOutputDir, params.verbose) | ||
| workQueueBackfillApplied := backfillWorkQueueReport(&result.WorkQueue, runOutputDir) | ||
| continuationBackfillApplied := backfillContinuationRequests(&result.ContinuationRequests, result.Run, runOutputDir, params.verbose) |
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "601802b069cd9138b50e1c3febd297fd4a05a063",
"kind": "requested",
"schema_version": "1",
"state": "083cedf6d4e09e76cac060080c6aa62c89049c62c77d8a941377e53cb25db27f",
"work": [
"0601b28a3a48debacd2e6e1907cfdac8b14f55ad7ca14702da5b7528485340fa",
"0aa130d4ac40f03a31063bad7021001b6db4ffa3374df9e34ad76814b36c7aa7",
"21313d9aa37b9c97201cbc55f233a87fabde8b3d37daef39d577c1f20926d5d6",
"4c69431a65da73ecef2d4bc1b979a270a8918f459bd1bef6127a711108aa01fc",
"4dbc0715797f1bf10021b853f124214fa3f875a36cc2f831442a781bad91d391",
"602c6fb637139d2bc2a83d1fbd6839a77b4ac08092e816c47d8c31b89c7b10ef",
"602ff420c60152b800db81ae92ab9a516e4194a9b9ab775d196120c1f67f5edf",
"763e5d4a61e4791d5c625dd358a748f66745ed61b621d6dd0c2727702dcfdb90",
"7c1014a4c21406865e219418bbfe9aef93a270ce1c815da7b69482fae240d761",
"82be00bfd0db1fb5b2401211fc695b23dbd1ad805676e59fcc6f9f1c45796713",
"8bd52e14687f048e33feae11acb6b5ec8faa3c334cbb01568e72358363de6940",
"8efb855c838e321fad38f102f00783ba1718b5e708fe0ea8cf4dd605d32c8e64",
"92360ec66fff35c2e514210923dcbee4f2a2d9fcd673888035935ca44feb99e7",
"b0ac9b4a9a2d9a318750fcbbb67e3605cadd8845a2b4e68141353cdf239e0b67",
"b33da8d1aba6c024a2e91721bd2be848d302ada084bb183574899a12aaee5b61",
"be7dcb4844047a0844399a696cafd5f6ae0e7793db2872e7ec12398122a07ec4",
"d095bc28db3b7aa2024c4c928927ac431ea7aa4ada7fd1ba683329800199afa7"
],
"workflow": "pr-sous-chef"
}
|
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
- Sort health continuation request runs by run ID so health output is independent of input order - Expect the bounded max error for request-continuation in the max coverage test - Accept extra frontmatter keys (e.g. spec: true) in the work-queue docs test
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
- Guard GH_AW_AGENT_OUTPUT before reading it in record_request_continuation.cjs - Handle strconv.Atoi error for cached run attempts instead of discarding it - Only bypass the cached audit for missing agent output when agent output was explicitly requested (agent, outcomes, graders sets); default and log-only sets such as work-queue keep using the cache
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
- Recompile contribution-check, mattpocock-skills-reviewer, and spec-extractor against current main pins
91927b3 to
76c7c6d
Compare


Add opt-in continuation requests across three agentic workflows, with noop-style special handling and analytics in
audit,logs, andhealth.request_continuationwith bounded recording. Requests express remaining work—not automatic reruns, terminal noops, or verified completion—and receive dedicated logging and internal-tool classification.Existing Copilot autopilot and durable-session behavior remain unchanged.
✨ PR Review Safe Output Test - Run 44941123431