fix(github-repo-monitor): silence 409 in fire_callback; document PATCH re-enable#275
Open
tofarr wants to merge 2 commits into
Open
fix(github-repo-monitor): silence 409 in fire_callback; document PATCH re-enable#275tofarr wants to merge 2 commits into
tofarr wants to merge 2 commits into
Conversation
…H re-enable
The automation service marks a run COMPLETED on process exit. The
explicit fire_callback("COMPLETED") call at script end then races
against that and receives HTTP 409 Conflict, producing a noisy
"Callback error (non-fatal)" line in every run log.
Fix: catch HTTPError 409 specifically and return without printing —
it means the run is already done, which is the desired state.
Also add two troubleshooting rows to SKILL.md:
- The 409 symptom, its root cause, and the fix.
- The PATCH-resets-enabled behaviour: after PATCHing an automation
the service sets enabled=false; a follow-up PATCH {"enabled":true}
is required to reactivate it.
Co-authored-by: openhands <openhands@all-hands.dev>
…E_URL check
The previous 'Local mode only' callout and the AGENTS.md guidance both
used 'local/sandboxed environment' as the criterion for choosing cron
polling over event triggers. This is imprecise — in production K8s pods
AGENT_SERVER_URL and HOST are absent, but RUNTIME_URL is set to a
reachable external URL.
Replace with a concrete, executable check:
echo "RUNTIME_URL=${RUNTIME_URL}"
- set and not localhost/127.0.0.1 → environment can receive GitHub
webhooks → prefer event-triggered automation
- unset, empty, or localhost → use cron polling (this skill)
Changes:
- Update the intro callout to reference RUNTIME_URL explicitly.
- Add Step 0 to the Setup Workflow so the agent checks RUNTIME_URL
before proceeding and surfaces the event-trigger recommendation to
the user when appropriate.
Co-authored-by: openhands <openhands@all-hands.dev>
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.
Problem 1 — Noisy 409 in every run log
Every run of a
github-repo-monitorautomation logs:Root cause: The automation service marks a run COMPLETED on process exit.
The explicit
fire_callback("COMPLETED")call at the end of the script thentries to write the same status a second time and receives HTTP 409 Conflict.
Because this was caught by the bare
except Exceptionhandler it was printedon every run, giving the impression something had gone wrong.
Fix (
scripts/main.py): Catchurllib.error.HTTPErrorbefore the bareExceptionand return silently on 409.Problem 2 — Vague 'local mode only' guidance
The previous intro callout said 'Local mode only' without giving agents a
concrete way to decide whether the current environment can receive GitHub
webhook events. In production Kubernetes pods
AGENT_SERVER_URLandHOSTare absent, but
RUNTIME_URLis set to a reachable external URL.Fix (
SKILL.md):RUNTIME_URL-based rule:set and not
localhost/127.0.0.1→ prefer event trigger;unset, empty, or local → use cron polling.
echo "RUNTIME_URL=${RUNTIME_URL}"and surfaces the event-triggerrecommendation to the user before proceeding with polling setup.
Additional docs (
SKILL.mdTroubleshooting table)Two new rows:
Callback error (non-fatal): HTTP Error 409: Conflictin run logsscripts/main.py(this PR)enabledtofalse{"enabled": true}Testing
Discovered and verified in a live
dev:automationstack runninggithub-repo-monitoragainsttofarr/polling-experiment.Production K8s pod env-var inventory confirmed
RUNTIME_URLas thecorrect discriminator (not
HOSTorAGENT_SERVER_URL).This PR was created by an AI agent (OpenHands) on behalf of the user.