Skip to content

fix(commands): honor pause for configuration comments#4077

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-configuration-command-access-control
Jul 8, 2026
Merged

fix(commands): honor pause for configuration comments#4077
JSONbored merged 1 commit into
mainfrom
codex/fix-configuration-command-access-control

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Prevent the @gittensory configuration handler from performing a live GitHub comment when agent actions are paused, in dry-run, or globally frozen by the DB.
  • Ensure the displayed/audited mode reflects the DB-backed global freeze in addition to env/repo pause/dry-run settings.
  • Restore a few malformed regate/queue wiring sites that broke typechecking and test loading.

Description

  • In src/queue/processors.ts the effective mode is now resolved with globalPaused: isGlobalAgentPause(env) || (await isGlobalAgentFrozen(env)) and the handler routes the response through the mode-aware createOrUpdateAgentCommandComment(..., mode) instead of the live-only createIssueComment.
  • Fixed several regate/fan-out call-site wiring issues so the per-PR job payload and retry metadata are correctly constructed and the function signatures are ordered to satisfy TypeScript.
  • Updated test/unit/queue.test.ts to account for the marker-search GET probe in the mode-aware helper and added regression tests (it.each) that assert env pause, repo pause, repo agentDryRun, and DB global freeze prevent live comment posts while preserving the audited mode metadata.
  • Added an import/use of setGlobalAgentFrozen in tests to exercise the DB freeze path.

Testing

  • Ran git diff --check which produced no whitespace/conflict issues and was successful.
  • Ran targeted tests with npx vitest run test/unit/queue.test.ts -t "configuration" and the modified unit tests passed (the test file ran and the configuration-related tests succeeded).
  • Ran type checking with npm run typecheck and it completed with no TypeScript errors.
  • Attempted npm audit --audit-level=moderate but the npm audit endpoint returned 403 Forbidden in this environment so the audit could not complete.

Codex Task

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored
JSONbored force-pushed the codex/fix-configuration-command-access-control branch from 4220d20 to fdcd074 Compare July 8, 2026 02:44
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.65%. Comparing base (1ec9f94) to head (fdcd074).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4077   +/-   ##
=======================================
  Coverage   93.65%   93.65%           
=======================================
  Files         384      384           
  Lines       35865    35866    +1     
  Branches    13160    13161    +1     
=======================================
+ Hits        33589    33590    +1     
  Misses       1618     1618           
  Partials      658      658           
Files with missing lines Coverage Δ
src/queue/processors.ts 95.15% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 8, 2026
@loopover-orb

loopover-orb Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-08 03:21:52 UTC

2 files · 1 AI reviewer · 3 blockers · readiness 93/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
  • AI reviewers agree on a likely critical defect: Per this repo's contribution policy, external PRs must close or clearly link an eligible open issue
  • the description names no issue, so this should not be marked merge-ready until that's added. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
This diff makes the configuration comment handler respect global pause/freeze state end-to-end: it augments `globalPaused` in `resolveAgentActionMode` with `isGlobalAgentFrozen(env)` and routes the reply through the mode-aware `createOrUpdateAgentCommandComment` instead of the always-live `createIssueComment`. The test changes correctly split the `/issues/77/comments` fetch stub by HTTP method (GET for the marker-search probe the mode-aware helper performs, POST for the actual post) and add `it.each` regression coverage for env pause, repo pause, repo dry-run, and DB global freeze, asserting zero comment posts and correct audited `mode` metadata. The core fix is traceable and looks correct given the visible code, but the PR description claims broader 'regate/fan-out call-site wiring' fixes that aren't visible in this diff, and there's no linked issue for this contributor PR.

Blockers

  • Per this repo's contribution policy, external PRs must close or clearly link an eligible open issue; the description names no issue, so this should not be marked merge-ready until that's added.
Nits — 5 non-blocking
  • The description claims several regate/queue call-site wiring fixes (job payload/retry metadata, function signature ordering) beyond what's shown in this 2-file, 36-line diff — confirm those changes are actually included or drop the claim if they landed in a separate commit not shown here.
  • Can't verify from the diff alone that `createOrUpdateAgentCommandComment(env, installationId, repoFullName, issueNumber, body, mode)`'s parameter order/signature matches its definition — worth double-checking since a swapped `mode`/`body` argument would silently misbehave rather than throw.
  • The external brief flags a 'generic_secret_assignment' at test/unit/queue.test.ts:10789, but this is almost certainly `await generatePrivateKeyPem()` in `createTestEnv(...)`, consistent with the existing pattern used earlier in the same file — looks like a false positive, not a real leaked secret.
  • Add the issue link/number to the PR description per repo convention.
  • Consider a one-line comment above the `isGlobalAgentPause(env) || (await isGlobalAgentFrozen(env))` expression noting that the DB freeze is intentionally OR'd with the env-level pause, since future readers may assume they're mutually exclusive gates.

Concerns raised — review before merging

  • Per this repo's contribution policy, external PRs must close or clearly link an eligible open issue; the description names no issue, so this should not be marked merge-ready until that's added.
  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
Signal Result Evidence
Code review ❌ 3 blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 51 registered-repo PR(s), 43 merged, 505 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 51 PR(s), 505 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, JavaScript, Ruby, Go, Kotlin, MDX, Shell
  • Official Gittensor activity: 51 PR(s), 505 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 8, 2026
@JSONbored
JSONbored merged commit c79662c into main Jul 8, 2026
10 checks passed
@JSONbored
JSONbored deleted the codex/fix-configuration-command-access-control branch July 8, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

1 participant