Skip to content

Remove the client-side issue_intents runtime gate#45275

Open
pelikhan with Copilot wants to merge 8 commits into
mainfrom
copilot/remove-issue-intents-gate
Open

Remove the client-side issue_intents runtime gate#45275
pelikhan with Copilot wants to merge 8 commits into
mainfrom
copilot/remove-issue-intents-gate

Conversation

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Issue intent metadata had moved behind a client-side GH_AW_RUNTIME_FEATURES=issue_intents opt-in even though the server-side flag is authoritative and safely ignores unsupported intent payloads. This change removes that client-side gate so the intent-capable paths are used consistently without environment-variable coordination.

  • Always-on intent-capable tool descriptions

    • set_issue_type, set_issue_field, and add_labels now always include the intent guidance suffix in generated safe-output tool definitions.
    • Unrelated runtime features no longer affect issue-intent descriptions.
  • Always-on issue type intent path

    • set_issue_type now always uses the structured GraphQL IssueTypeUpdateInput path with GraphQL-Features: update_issue_suggestions for non-clear updates.
    • Clear operations still use the existing REST clear behavior.
  • Always-on issue field intent metadata

    • set_issue_field now always attaches normalized rationale, confidence, and suggest metadata when present, and always sends the feature header.
    • Calls that omit optional intent metadata continue to work unchanged.
  • Label compatibility preserved while keeping structured metadata

    • add_labels now preserves structured label metadata whenever it is provided, while still sending plain string labels for string-only inputs.
    • update_issue now always uses the existing GraphQL label-intent mutation path when labels are present, including string-only label payloads.
  • Gate removal cleanup

    • Removed hasIssueIntentsRuntimeFeature() and the unused issue_intents runtime-feature plumbing from the affected JS paths.
    • Left the generic GH_AW_RUNTIME_FEATURES infrastructure intact for other features.
  • Focused test updates

    • Removed test reliance on GH_AW_RUNTIME_FEATURES=issue_intents.
    • Added/updated coverage for unconditional intent guidance, unconditional mutation behavior, string-label compatibility, lowercase confidence normalization, omitted optional metadata, and preserved clear-mode behavior.

Example of the new unconditional issue-type path:

await github.graphql(
  `mutation($issueId: ID!, $issueType: IssueTypeUpdateInput!) {
    updateIssue(input: { id: $issueId, issueType: $issueType }) {
      issue { id }
    }
  }`,
  {
    issueId,
    issueType: {
      issueTypeId,
      rationale,
      confidence: "HIGH",
      suggest: true,
    },
    headers: { "GraphQL-Features": "update_issue_suggestions" },
  }
);

Generated by 👨‍🍳 PR Sous Chef · 9.13 AIC · ⌖ 8 AIC · ⊞ 5.1K ·
Comment /souschef to run again

Copilot AI and others added 3 commits July 13, 2026 15:28
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove the issue_intents runtime feature gate Remove the client-side issue_intents runtime gate Jul 13, 2026
Copilot AI requested a review from pelikhan July 13, 2026 15:38
@pelikhan pelikhan marked this pull request as ready for review July 13, 2026 15:40
Copilot AI review requested due to automatic review settings July 13, 2026 15: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

Removes the client-side issue-intent gate so supported issue mutations consistently use intent-capable payloads.

Changes:

  • Enables intent guidance and metadata unconditionally.
  • Routes issue types, fields, and label updates through intent-capable APIs.
  • Updates focused tests for always-on behavior and compatibility.
Show a summary per file
File Description
actions/setup/js/update_issue.cjs Makes GraphQL label updates unconditional.
actions/setup/js/update_issue.test.cjs Tests structured and string label updates.
actions/setup/js/set_issue_type.cjs Always uses GraphQL except when clearing.
actions/setup/js/set_issue_type.test.cjs Updates GraphQL-path coverage.
actions/setup/js/set_issue_field.cjs Always attaches metadata and feature header.
actions/setup/js/set_issue_field.test.cjs Tests unconditional field intents.
actions/setup/js/issue_intents.cjs Removes gate helper and adds label normalization.
actions/setup/js/generate_safe_outputs_tools.cjs Always adds intent guidance.
actions/setup/js/generate_safe_outputs_tools.test.cjs Tests unconditional guidance.
actions/setup/js/add_labels.cjs Preserves structured label metadata.
actions/setup/js/add_labels.test.cjs Tests metadata preservation and normalization.

Review details

Tip

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

  • Files reviewed: 11/11 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment thread actions/setup/js/update_issue.cjs
Comment thread actions/setup/js/add_labels.cjs
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

…n dup dedup

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

Two review-flagged issues addressed in a60e6a2:

  • update_issue.cjs: Label IDs are now resolved and validated via buildIssueIntentLabelUpdates before the REST issues.update call, so a nonexistent label fails cleanly with no partial write.
  • add_labels.cjs: The deduplication map now prefers the metadata-bearing entry — a later duplicate carrying rationale/confidence/suggest replaces a prior metadata-free entry for the same label name.

Both fixes are covered by new test cases and all 94 unit tests pass.


  • ✅ Reviews — both unresolved threads addressed in code (see above)
  • ✅ Checks (local) — make fmt, make lint, make test-unit all pass; 0 lint errors
  • ❓ Checks (CI) — stale after agent push; needs human re-trigger
  • ✅ Mergeable — PR is open, not draft

Hand-off: CI must be re-triggered by a maintainer (close/reopen, workflow_dispatch, or a new push) before merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address these unresolved review comments, and rerun checks once finished:

Generated by 👨‍🍳 PR Sous Chef · 9.23 AIC · ⌖ 10.8 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address these unresolved review comments, and rerun checks once finished:

Both review threads were addressed in a60e6a2 (from the previous session):

  • update_issue.cjs — label IDs resolved/validated before the REST update, preventing partial writes on nonexistent labels.
  • add_labels.cjs — deduplication map prefers the metadata-bearing entry when a later duplicate carries rationale/confidence/suggest.

94 unit tests pass; make fmt and make lint are clean. Replied to both threads directly. Thread resolution via GraphQL is not available in this environment (API returns 403), so a human maintainer will need to mark them resolved.

Copilot AI requested a review from gh-aw-bot July 13, 2026 18:22
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address unresolved review feedback, and rerun checks once the branch is up to date.

Generated by 👨‍🍳 PR Sous Chef · 9.9 AIC · ⌖ 5.48 AIC · ⊞ 7.5K ·
Comment /souschef to run again

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage (run 29275650494)\n\nCategory: feature | Risk: medium | Score: 68/100 | Action: fast_track\n\nScore: Impact 35/50 + Urgency 20/30 + Quality 13/20\n\nRemoves client-side issue_intents runtime gate - server-side flag is authoritative and safely ignores unsupported payloads. Simplifies code (-305/+455), non-draft, good description. Ready for review.

Generated by 🔧 PR Triage Agent · 181.5 AIC · ⌖ 7.71 AIC · ⊞ 5.6K ·

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address unresolved review feedback, and rerun checks once the branch is up to date.

...

All review feedback was addressed in commit a60e6a2 (previous session):

  • update_issue.cjs: Label IDs are resolved and validated via buildIssueIntentLabelUpdates before github.rest.issues.update is called — no partial writes possible on nonexistent labels.
  • add_labels.cjs: Deduplication map prefers the metadata-bearing entry when a later duplicate carries rationale/confidence/suggest intent fields.

Both reviewer threads already have replies with commit reference. Thread resolution via GraphQL returns 403 in this environment — a maintainer will need to mark them resolved manually.

Local validation status:

  • make fmt — clean
  • make lint — 0 errors (165 pre-existing warnings, none from changed files)
  • make test-unit — all tests pass
  • make agent-report-progress — lock files in sync, 0 lint errors
  • ❓ CI — action_required runs are human-approval gates, not test failures; needs maintainer re-trigger after branch is current

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address unresolved review comments, and rerun checks once the branch is up to date.

Generated by 👨‍🍳 PR Sous Chef · 9.13 AIC · ⌖ 8 AIC · ⊞ 5.1K ·
Comment /souschef to run again

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address unresolved review comments, and rerun checks once the branch is up to date.

...

The branch is up to date — it was merged with main at 6dc67a5. Both review threads are addressed in a60e6a2 with replies already posted. Local validation is clean (make fmt, make lint, make test-unit, make agent-report-progress all pass).

The only remaining step is human: the two copilot-pull-request-reviewer threads need to be marked resolved in GitHub UI (GraphQL resolution returns 403 for this agent), and CI needs a maintainer re-trigger (close/reopen, workflow_dispatch, or a new push) since agent pushes don't trigger workflows.

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

pr-sous-chef
@copilot please run the pr-finisher skill, confirm the two replied-to review threads are resolved, and rerun checks once the branch is up to date:

Run: https://github.com/github/gh-aw/actions/runs/29280443144

Generated by 👨‍🍳 PR Sous Chef · 7.51 AIC · ⌖ 6.11 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

pr-sous-chef
@copilot please run the pr-finisher skill, confirm the two replied-to review threads are resolved, and rerun checks once the branch is up to date:

  • copilot-pull-request-reviewer: htt...

Both threads are confirmed resolved:

  • update_issue.cjs thread — ✅ resolved
  • add_labels.cjs thread — ✅ resolved

Branch is up to date with main. Local validation is clean. CI needs a maintainer re-trigger (close/reopen or workflow_dispatch) since agent pushes don't trigger workflows.

@pelikhan

Copy link
Copy Markdown
Collaborator

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

pr-sous-chef
@copilot please run the pr-finisher skill, address any remaining review feedback, and rerun checks once the branch is up to date.

Run: https://github.com/github/gh-aw/actions/runs/29286484887

Generated by 👨‍🍳 PR Sous Chef · 9.66 AIC · ⌖ 6.15 AIC · ⊞ 5.1K ·
Comment /souschef to run again

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix https://github.com/github/gh-aw/actions/runs/29278948824/job/86937413257

Fixed in db69fed. The TypeScript error TS18047: 'labelIntentUpdates' is possibly 'null' on update_issue.cjs:129 was caused by the @type {any[] | null} declaration not being narrowed when buildIssueIntentLabelUpdates (inferred as any) was assigned. Added a /** @type {any[]} */ cast on the assignment so TypeScript knows the result is non-null, matching the function's actual behavior (it always returns an array or throws).

Note: the commit is local but the push is currently blocked by a 403 on the remote — a maintainer may need to re-trigger credentials or push from their end.

…eck error

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

pr-sous-chef
@copilot please run the pr-finisher skill, address any remaining review feedback, and rerun checks once the branch is up to date.
...

Fixed in 9b07567. Changed the @type {any[] | null} annotation on labelIntentUpdates to @type {any} — TypeScript now accepts the .length access at line 129, and the existing null-guard at line 144 continues to work unchanged. make build-js, make fmt, make lint, and make agent-report-progress all pass locally. CI needs a maintainer re-trigger to go green.

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.

Remove the issue_intents runtime feature gate

4 participants