Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions .github/scripts/__tests__/agents-pr-meta-update-body.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ test('extractExplicitIssueSyncNumbers returns only explicit issue references', (
);
});

test('resolveNonIssueWorkflowSourceContextForBodySync honors explicit non-issue markers over heuristics', () => {
test('resolveNonIssueWorkflowSourceContextForBodySync yields to branch-inferred issue numbers', () => {
const branchHeuristicContext = resolveNonIssueWorkflowSourceContextForBodySync(
{
body: [
Expand All @@ -577,8 +577,7 @@ test('resolveNonIssueWorkflowSourceContextForBodySync honors explicit non-issue
123,
);

assert.equal(branchHeuristicContext.sourceType, 'local_request');
assert.equal(branchHeuristicContext.sourceRef, 'codex-thread-2026-04-26');
assert.equal(branchHeuristicContext, null);

const prReferenceContext = resolveNonIssueWorkflowSourceContextForBodySync(
{
Expand All @@ -591,8 +590,24 @@ test('resolveNonIssueWorkflowSourceContextForBodySync honors explicit non-issue
123,
);

assert.equal(prReferenceContext.sourceType, 'review_followup');
assert.equal(prReferenceContext.sourceRef, 'PR #123');
assert.equal(prReferenceContext, null);
});

Comment thread
stranske marked this conversation as resolved.
test('resolveNonIssueWorkflowSourceContextForBodySync preserves explicit non-issue markers without issue number', () => {
const context = resolveNonIssueWorkflowSourceContextForBodySync(
{
body: [
'<!-- workflow-source:local_request -->',
'<!-- workflow-source-ref:codex-thread-2026-04-26 -->',
].join('\n'),
head: { ref: 'codex/local-request' },
title: 'Follow-up',
},
null,
);

assert.equal(context.sourceType, 'local_request');
assert.equal(context.sourceRef, 'codex-thread-2026-04-26');
});

test('resolveNonIssueWorkflowSourceContextForBodySync yields to explicit issue references', () => {
Expand All @@ -610,7 +625,7 @@ test('resolveNonIssueWorkflowSourceContextForBodySync yields to explicit issue r
assert.equal(context, null);
});

test('resolveNonIssueWorkflowSourceContextForBodySync preserves non-issue context when explicit issue differs from heuristic', () => {
test('resolveNonIssueWorkflowSourceContextForBodySync yields to issue numbers even when explicit issue differs', () => {
const context = resolveNonIssueWorkflowSourceContextForBodySync(
{
body: [
Expand All @@ -623,8 +638,7 @@ test('resolveNonIssueWorkflowSourceContextForBodySync preserves non-issue contex
99,
);

assert.equal(context.sourceType, 'local_request');
assert.equal(context.sourceRef, 'codex-thread-2026-04-26');
assert.equal(context, null);
});

test('resolveSourceContextRepairComment updates an existing warning once', async () => {
Expand Down
14 changes: 14 additions & 0 deletions .github/scripts/__tests__/source-context.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,20 @@ automation: no_automation
}), true);
});

test('resolvePrSourceContext preserves legacy human-only no-automation wording', () => {
const context = resolvePrSourceContext({
body: `
## Workflow Source

Started from:
- [x] Human-only
`,
});

assert.equal(context.sourceType, SOURCE_TYPES.MANUAL_REMOTE);
assert.equal(context.noAutomation, true);
});

test('sourceTypeFromCheckedTemplate rejects ambiguous checked source choices', () => {
const body = `
## Workflow Source
Expand Down
3 changes: 1 addition & 2 deletions .github/scripts/agents_pr_meta_update_body.js
Original file line number Diff line number Diff line change
Expand Up @@ -1055,8 +1055,7 @@ function resolveNonIssueWorkflowSourceContextForBodySync(pr = {}, issueNumber =
if (!explicitNonIssueSourceContext) {
return null;
}
const explicitIssueNumbers = extractExplicitIssueSyncNumbers(pr);
if (issueNumber && explicitIssueNumbers.has(Number(issueNumber))) {
if (issueNumber != null) {
return null;
}
return explicitNonIssueSourceContext;
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/source_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const CHECKBOX_SOURCE_PATTERNS = Object.freeze([
[SOURCE_TYPES.DEPENDABOT, /\bdependabot\b|\bdependency\s+update\b/i],
]);

const NO_AUTOMATION_CHECKBOX_PATTERN = /\bdo\s+not\s+automate\b/i;
const NO_AUTOMATION_CHECKBOX_PATTERN = /\bdo\s+not\s+automate\b|\bhuman[- ]only\b/i;

function cleanString(value) {
return String(value || '').trim();
Expand Down
10 changes: 8 additions & 2 deletions docs/LABELS.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Workflows source classification without forcing a GitHub issue.
| `workflow:source-dependabot` | Pull Requests | PR source is Dependabot or dependency automation.
| `workflow:source-review-followup` | Pull Requests | PR source is review feedback follow-up.
| `workflow:source-direct-pr` | Pull Requests | PR was started directly on GitHub without a source issue.
| `workflow:no-automation` | Pull Requests | Automation should not manage the PR unless checks fail.
| `workflow:no-automation` | Pull Requests | Fully opts the PR out of automation management and automation-triggered follow-up actions.
| `workflow:source-needed` | Pull Requests | Source context is missing or ambiguous.

The Workflow Source table is validated as a three-column Markdown table so label
Expand Down Expand Up @@ -416,7 +416,7 @@ These labels are used for categorization but do not trigger workflows.

### `needs-formatting`

**Applies to:** Issues
**Applies to:** Issues

**Effect:** Indicates the issue needs formatting to AGENT_ISSUE_TEMPLATE structure.

Expand Down Expand Up @@ -448,6 +448,12 @@ These labels are used for categorization but do not trigger workflows.
| (none) | `agents:optimize` | Analyzes and posts suggestions
| `agents:optimize` | `agents:apply-suggestions` | Applies suggestions, adds `agents:formatted`
| `agents:formatted` | `agent:codex` | Issue ready for agent processing
| `agents:auto-pilot` | `runner:<agent>` | Auto-pilot uses the selected runner when it dispatches work
| (none) | `agents:keepalive` | Enables keepalive monitoring for an agent PR
| `agents:keepalive` | `agents:paused` | Pauses keepalive and agent dispatch until resumed
| `agents:paused` | (removed) | Keepalive can resume on the next eligible event
| Merged PR with verifier report | `verify:create-issue` | Creates a verifier follow-up issue
| Merged PR with verifier report | `verify:create-new-pr` | Creates and bootstraps a verifier follow-up PR

---

Expand Down
22 changes: 15 additions & 7 deletions scripts/aggregate_agent_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,21 @@
_DEFAULT_ARTIFACT_SELECTION_PATH = "artifacts/metric-artifacts-selection.json"
_DEFAULT_UNSUPPORTED_VERIFIER_MODELS = {"gpt-5.2-codex"}
_DEFAULT_VERIFIER_MODEL_METADATA_REQUIRED_AFTER = ""
_NULL_EQUIVALENT_TOKENS = {"", "none", "null", "nil", "n/a", "na", "undefined", "unknown"}
_NULL_EQUIVALENT_TOKENS = {
"",
"0",
"false",
"none",
"null",
"nil",
"n/a",
"na",
"off",
"disabled",
"undefined",
"unknown",
}
_KNOWN_VERIFIER_MODES = {"checkbox", "compare", "evaluate"}
_MODEL_METADATA_REQUIRED_MODES = {"checkbox", "compare"}
_TERMINAL_ARTIFACT_FAMILIES = (
"review-thread-terminal-disposition",
"verifier-terminal-disposition",
Expand Down Expand Up @@ -472,13 +484,9 @@ def _normalize_verifier_mode(value: Any) -> str:
return verifier_mode


def _is_known_verifier_mode(value: Any) -> bool:
return _normalize_verifier_mode(value) in _KNOWN_VERIFIER_MODES


def _verifier_mode_requires_model_metadata(entry: dict[str, Any]) -> bool:
verifier_mode = _normalize_verifier_mode(entry.get("verifier_mode"))
return verifier_mode in _MODEL_METADATA_REQUIRED_MODES
return bool(verifier_mode) and verifier_mode != "evaluate"


def _summarise_keepalive(entries: list[dict[str, Any]]) -> dict[str, Any]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1055,8 +1055,7 @@ function resolveNonIssueWorkflowSourceContextForBodySync(pr = {}, issueNumber =
if (!explicitNonIssueSourceContext) {
return null;
}
const explicitIssueNumbers = extractExplicitIssueSyncNumbers(pr);
if (issueNumber && explicitIssueNumbers.has(Number(issueNumber))) {
if (issueNumber != null) {
return null;
}
return explicitNonIssueSourceContext;
Expand Down
2 changes: 1 addition & 1 deletion templates/consumer-repo/.github/scripts/source_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const CHECKBOX_SOURCE_PATTERNS = Object.freeze([
[SOURCE_TYPES.DEPENDABOT, /\bdependabot\b|\bdependency\s+update\b/i],
]);

const NO_AUTOMATION_CHECKBOX_PATTERN = /\bdo\s+not\s+automate\b/i;
const NO_AUTOMATION_CHECKBOX_PATTERN = /\bdo\s+not\s+automate\b|\bhuman[- ]only\b/i;

function cleanString(value) {
return String(value || '').trim();
Expand Down
Loading
Loading