Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/scripts/issue_context_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function buildCappedIssuePayload(issueBody, options = {}) {
const output = childProcess.execFileSync('python3', args, { encoding: 'utf8' });
const payload = JSON.parse(output);
return {
formattedBody: String(payload.formatted_body || body),
formattedBody: String(payload.formatted_body ?? body),
truncated: Boolean(payload.truncated),
estimatedTokens: payload.estimated_tokens,
tokenBudget: payload.token_budget,
Expand Down
6 changes: 0 additions & 6 deletions .github/scripts/sync_tracker_state/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,6 @@ function issueMatchesTracker(issue = {}, { label, titlePattern, markerPattern }
const hasDurableLabel = names.includes(DURABLE_TRACKER_LABEL);
const hasTitle = patternMatches(issue.title || '', titlePattern);
const hasMarker = issueHasMarker(issue, markerPattern);
if (titlePattern && hasTitle) {
return true;
}
if (markerPattern && hasTitle && !cleanString(issue.body)) {
return true;
}
return (hasDurableLabel || hasRequiredLabel || hasMarker) && (hasTitle || hasMarker);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve title-only tracker matching for unlabeled legacy issues

issueMatchesTracker no longer returns true when only titlePattern matches, so findTracker now skips existing tracker issues that lost both the durable/required labels (or predate them) before it ever calls getIssue for a full-body check. In that scenario, the workflow will create a new tracker instead of reusing the existing one, which can fork tracker state and duplicate automation comments/labels for the same logical thread.

Useful? React with 👍 / 👎.

}

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/agents-80-pr-event-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@ jobs:
debug: ${{ steps.resolve.outputs.debug }}
should_run: ${{ steps.eligibility.outputs.should-run || 'false' }}
steps:
- name: Checkout eligibility action
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
sparse-checkout: .github/actions/agent-event-eligibility
sparse-checkout-cone-mode: false

# Escape hatch: set mode: warning if false-negative skips appear post-merge.
- name: Check event eligibility
id: eligibility
uses: stranske/Workflows/.github/actions/agent-event-eligibility@main
uses: ./.github/actions/agent-event-eligibility
with:
expected-actions: >-
workflow_dispatch,created,opened,synchronize,reopened,edited,
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/agents-auto-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ jobs:
!contains(github.event.issue.labels.*.name, 'automated')

steps:
- name: Checkout eligibility action
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
sparse-checkout: .github/actions/agent-event-eligibility
sparse-checkout-cone-mode: false

# Escape hatch: set mode: warning if false-negative skips appear post-merge.
- name: Check event eligibility
id: eligibility
uses: stranske/Workflows/.github/actions/agent-event-eligibility@main
uses: ./.github/actions/agent-event-eligibility
with:
expected-actions: opened,reopened,edited
custom-predicate: >-
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/agents-auto-pilot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,16 @@ jobs:
outputs:
proceed: ${{ steps.eligibility.outputs.should-run }}
steps:
- name: Checkout eligibility action
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
sparse-checkout: .github/actions/agent-event-eligibility
sparse-checkout-cone-mode: false

# Escape hatch: set mode: warning if false-negative skips appear post-merge.
- name: Check event eligibility
id: eligibility
uses: stranske/Workflows/.github/actions/agent-event-eligibility@main
uses: ./.github/actions/agent-event-eligibility
with:
expected-actions: workflow_dispatch,labeled,closed
custom-predicate: >-
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/agents-autofix-dispatcher.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Agents Autofix Dispatch

# Compatibility bridge for legacy Gate repository_dispatch events. Gate-driven
# repair routing now lives in agents-81-gate-followups.yml via workflow_run, so
# this workflow only validates and logs the old dispatch payload.

on:
repository_dispatch:
types:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/agents-guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout eligibility action
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
sparse-checkout: .github/actions/agent-event-eligibility
sparse-checkout-cone-mode: false

# Escape hatch: set mode: warning if false-negative skips appear post-merge.
- name: Check event eligibility
id: eligibility
uses: stranske/Workflows/.github/actions/agent-event-eligibility@main
uses: ./.github/actions/agent-event-eligibility
with:
expected-labels: >-
agent:auto,agent:codex,agent:claude,agent:copilot,
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,16 @@ jobs:
dispatch_should_run: ${{ steps.runner_dispatch.outputs.should_dispatch || 'true' }}
dispatch_reason: ${{ steps.runner_dispatch.outputs.reason }}
steps:
- name: Checkout eligibility action
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
sparse-checkout: .github/actions/agent-event-eligibility
sparse-checkout-cone-mode: false

# Escape hatch: set mode: warning if false-negative skips appear post-merge.
- name: Check event eligibility
id: eligibility
uses: stranske/Workflows/.github/actions/agent-event-eligibility@main
uses: ./.github/actions/agent-event-eligibility
with:
expected-actions: completed,labeled
custom-predicate: >-
Expand Down
29 changes: 24 additions & 5 deletions scripts/runner_lib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,29 @@ def _decode_record_candidate(candidate: str) -> str:
return value


def _marker_safe_text(value: Any, limit: int = 1000) -> str:
text = str(value or "")
if len(text) > limit:
text = f"{text[:limit]}...[truncated {len(text) - limit} chars]"
return text.replace("-->", "--\\u003e")


def _compact_runner_result_payload(result_payload: dict[str, Any]) -> dict[str, Any]:
final_message = str(result_payload.get("final_message") or "")
compact: dict[str, Any] = {
"schema": "runner-result-summary/v1",
"provider": str(result_payload.get("provider") or ""),
Comment on lines +415 to +425
"success": bool(result_payload.get("success")),
"summary": _marker_safe_text(result_payload.get("summary")),
"error": _marker_safe_text(result_payload.get("error")),
"truncated": bool(result_payload.get("truncated")),
}
if final_message:
compact["final_message_sha256"] = hashlib.sha256(final_message.encode("utf-8")).hexdigest()
compact["final_message_chars"] = len(final_message)
return compact


def _extract_record(value: str | None, pr_number: int, provider: str) -> dict[str, Any] | None:
if not value:
return None
Expand Down Expand Up @@ -695,17 +718,13 @@ def record_completion(
dataclasses.asdict(result) if dataclasses.is_dataclass(result) else dict(result)
)
status = "completed" if result_payload.get("success") else "error"
compact_result = _compact_runner_result_payload(result_payload)
prior = storage.read_record(pr_number, provider) or {}
completed_at = (
prior.get("completed_at")
if prior.get("key") == key and prior.get("status") in TERMINAL_STATUSES
else _utc_now()
)
compact_result = {
field: result_payload.get(field)
for field in ("provider", "success", "summary", "error", "truncated")
if field in result_payload
}
record = {
**prior,
"provider": provider,
Expand Down
11 changes: 5 additions & 6 deletions scripts/sync_test_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
PYPROJECT_FILE = Path("pyproject.toml")
DEV_EXTRA = "dev"

# Stdlib modules that don't need to be installed (keep in sync with
# tests/test_dependency_enforcement.py)
STDLIB_MODULES = {
# Stdlib modules that don't need to be installed. Prefer Python's runtime
# inventory and keep a fallback for older runtimes/consumer scripts.
_FALLBACK_STDLIB_MODULES = {
"abc",
"argparse",
"ast",
Expand Down Expand Up @@ -75,9 +75,9 @@
"re",
"runpy",
"email",
"secrets",
"shlex",
"shutil",
"secrets",
"signal",
"sitecustomize",
"socket",
Expand Down Expand Up @@ -109,8 +109,7 @@
"traceback",
"pprint",
}
if hasattr(sys, "stdlib_module_names"):
STDLIB_MODULES.update(sys.stdlib_module_names)
STDLIB_MODULES = set(getattr(sys, "stdlib_module_names", ())) | _FALLBACK_STDLIB_MODULES

# Known test framework modules
TEST_FRAMEWORK_MODULES = {
Expand Down
Loading