feat(agent): auto-assign PR opener as GitHub assignee (#3182)#3209
Merged
Conversation
Adds `assign` as a new agent-layer action class alongside merge/close/ label/review_state_label, gated by its own per-repo autonomy dial (default observe/off, config-as-code via .gittensory.yml autonomy.assign, no DB migration needed since autonomy is a single JSON column). GitHub silently drops an assignee lacking push/triage access instead of erroring, so the executor detects that case and falls back to a per-login `contributor:<login>` label instead of spamming a comment every sweep.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | f6c9017 | Commit Preview URL Branch Preview URL |
Jul 04 2026, 08:21 PM |
Contributor
|
Important 🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪 🔍 Gittensory is reviewing…AI analysis is in progress. This comment will update when the review is complete. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3209 +/- ##
=======================================
Coverage 94.74% 94.75%
=======================================
Files 270 271 +1
Lines 29778 29803 +25
Branches 10861 10870 +9
=======================================
+ Hits 28214 28239 +25
Misses 918 918
Partials 646 646
🚀 New features to boost your workflow:
|
…h assignees fallback GitHub logins run up to 39 chars and label names cap at 50, so the "contributor:" prefix (12 chars) could push a valid max-length login past the limit and fail the fallback for exactly the contributors it exists to cover. Shortened to "by:". Also adds the missing test for ensurePullRequestAssignee's `?? []` fallback when a GitHub response omits the assignees field entirely, closing the codecov/patch gap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
assignas a new agent-layer action class (alongsidemerge/close/label/review_state_label/update_branch) that best-effort sets a PR's opening contributor as its GitHub assignee, gated by its own per-repoautonomy.assigndial (defaultobserve/off).autonomyis already a single JSON column (AutonomyPolicy), so a new action class is just a new literal in the sharedAGENT_ACTION_CLASSESarray —.gittensory.ymlparsing, the dashboard dial, and the approval queue all pick it up for free.ensurePullRequestAssignee(src/github/assignees.ts) detects this from the live response and the executor falls back to a per-logincontributor:<login>label instead of a comment, so a repeated sweep never spams (the label GET is naturally idempotent).Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
typecheck,git diff --check,ui:openapi:check(regenerated + verified), and the specific affected suites (test/unit/agent-actions.test.ts,test/unit/agent-action-executor.test.ts,test/unit/github-assignees.test.ts,test/unit/autonomy.test.ts,test/unit/openapi.test.ts,test/unit/ci-openapi-settings-parity.test.ts,test/unit/selfhost-config-examples.test.ts) plusnpm run test:changed(224 files / 5756 tests, all green — this touchessrc/queue/processors.tsso it coverstest/unit/queue.test.tstoo). No UI/MCP/workers files touched by this diff, soui:*/test:workers/build:mcp/test:mcp-packare out of scope. CI runs the full gate on push.Safety
autonomyenum regenerated vianpm run ui:openapi.)UI Evidencesection below... (N/A — backend-only change, no visible UI.)UI Evidence
N/A — backend-only change, no visible UI.
Notes
review_state_labelin the planner (src/settings/agent-actions.ts) as an independent, always-safe block — not folded into the merge/close disposition tree, since assignment has no bearing on CI/mergeability and shouldn't share failure modes with those higher-stakes actions.