Repository navigation
🐛 fix: supported agent channels and issue-opened evaluation wake - #15904
Conversation
Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. |
There was a problem hiding this comment.
Read the diff at 445a3f3 against v5 and the callers. Looks correct to me.
- Backend.
webhookIssueDirtyTarget(webhook_cache.go:603-612) addingopenedfeeds the sameres.DirtyIssuesthatwebhookWakeReason(api_github_webhook.go:208-210) already turns into aWebhookWake, so no new dispatcher is introduced and the invalid-signature path is unchanged (TestGitHubIssueOpenedDeliveryWakesExistingEvaluationcovers both). One side effect worth knowing:markIssueDirtyalso incrementsTakeDirtyIssueCount(webhook_cache.go:253-271), so an opened issue now also lets the un-park sweep run ahead of its interval. Harmless — the sweep is a no-op for an issue that was never parked — but it is a small extra scheduling effect the body doesn't mention. - Client.
handleAgentConfigChannelsreturnsjsonError→{"ok":false,"error":msg}(api.go:663-666; api_agent_config.go:1243-1246), which is exactly what the newsaveChannelsreads. The_configState === stateguard is sound becauseconfig-dialog.js:7and:60assign a fresh object on open/close.state.data.channelsis now only written after a 2xx, so a 400 fromValidateChannelsno longer leaves the rejected edit in the local model. - Unmentioned fix. The old render emitted
data-arg0="+i+"as a literal string (quotes were inside the JS string), so toggle/remove on existing channels passed"+i+"as the index. This PR corrects it todata-arg0="'+i+'"(config-agent.js:636-637). Worth a line in the body since it's a real behaviour fix beyond the stated scope.
CHANNEL_COLORS still lists the removed types, which is right: persisted webhook/discord/schedule/bead entries still render with their colour and can be removed.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Signed-off-by: Andy Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Read the tree at bab8a74 before the body. Looks correct to me.
Backend. webhookIssueDirtyTarget (src/pkg/github/webhook_cache.go:603-613) is the only caller change; the PR-shaped and unknown-repo guards it inherits are unchanged. Adding opened has exactly two downstream effects, both read: res.DirtyIssues feeds webhookWakeReason (src/pkg/dashboard/api_github_webhook.go:208) so the eval wake fires, and markIssueDirty lets runIssueUnparkSweepIfDue run early (src/cmd/hive/main_sweeps.go:1416); the sweep's own gates are inside SweepIssueUnparkCommands, so an early tick on a freshly opened issue is harmless. The new TestGitHubIssueOpenedDeliveryWakesExistingEvaluation pins the signature gate (401, no wake) before the verified path.
UI. The identity guard _configState === state is sound because the dialog reassigns _configState on open and close (config-dialog.js:7, :60) rather than mutating it, so a late response from a closed dialog cannot toast or re-render. saveChannels now reads data.error, which matches jsonError(w, err.Error(), 400) from config.ValidateChannels at api_agent_config.go:1243-1244. One thing the body does not mention: the old row markup had data-arg0="+i+" inside a single string literal (config-agent.js:635-636 on v5), so toggle/remove always received the literal text +i+ as the index; the new quoting ('"+i+"') fixes that.
Docs. event.kind == "issue.opened" and event.repo exist (celtrigger.go:34, :65), GITHUB_WEBHOOK_SECRET is the receiver's env var (api_github_webhook.go:26), and the #webhook-driven-pr-cache-invalidation anchor resolves (operator-reference.md:1735).
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from docs-currency (read head bab8a74) The new docs check out against the code: One operator-facing example still contradicts the new text:
|
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Resolve the operator-reference.md conflict by keeping the redirect stub and porting the #15904 webhook wording (issues opened/labeled/unlabeled wake evaluation, CEL trigger pointer, Agent Channels kick-only) into operator-reference/runtime-and-quota.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Root cause
The agent Channels form still offered webhook/discord/schedule/bead after their trigger runtimes were removed (#5591). The owner-only PUT /api/config/agent/{name}/channels correctly rejects them with HTTP 400, but the client discarded its actionable JSON error and retained the rejected local edit.
Separately, a signed issues opened delivery scheduled a targeted item refresh but did not wake the governor: only relabeled issues entered the existing dirty-issue wake path. This left first-seen CEL issue rules waiting for reconciliation.
Changes
Validation
CI-only per AGENTS.md. Added UI execution guards for successful/rejected saves, authenticated request shape, state preservation and async races; backend validation/persistence invocation preservation; and verified versus invalid-signature issue-opened wake coverage. Regenerated embedded SPA with make dashboard-gen. Changed Go files pass gofmt -l. Existing #15889 covers once-per-item CEL routing. No deployment, live configuration changes or webhook registration.