Skip to content

fix(repo-monitor): honor AUTOMATION_MODEL profile - #606

Open
onatozmenn wants to merge 1 commit into
OpenHands:mainfrom
onatozmenn:fix/repo-monitor-automation-model
Open

onatozmenn wants to merge 1 commit into
OpenHands:mainfrom
onatozmenn:fix/repo-monitor-automation-model

Conversation

@onatozmenn

@onatozmenn onatozmenn commented Sep 18, 2026

Copy link
Copy Markdown

HUMAN:

I ran the targeted github-repo-monitor tests and confirmed the profile-resolution case fails on base but passes with the fix, with no new ruff findings beyond the existing ones.


Why

github-repo-monitor builds its conversation payload from the agent server's active profile and never reads AUTOMATION_MODEL, so monitor automations silently run on whatever profile is active in the UI instead of their configured one.

Summary

Issue Number

Fixes #428

How to Test

  • python -m pytest tests/test_github_repo_monitor.py -q → 3 passed. On base, the profile-resolution test fails (no profile request is made).
  • python -m ruff check on touched files: no new findings (2 pre-existing F541s on base); scripts/sync_extensions.py --check fails identically on base (locale decode issue in this env), unrelated.

Companion reproduction record with template sections: #605.

Type

Bug fix

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions github-actions Bot added the type: fix A bug fix label Sep 18, 2026
@onatozmenn
onatozmenn marked this pull request as ready for review September 18, 2026 13:32
Copilot AI lite review requested due to automatic review settings September 18, 2026 13:32
@all-hands-bot

Copy link
Copy Markdown
Contributor

👋 This PR needs a couple of things fixed before OpenHands can review it:

  • the PR description's HUMAN: section needs at least 20 characters describing what you tested, not just the template placeholder

Push an update once this is addressed and this check re-runs automatically.

This is an automated check - no AI was used to generate this comment.

1 similar comment
@all-hands-bot

Copy link
Copy Markdown
Contributor

👋 This PR needs a couple of things fixed before OpenHands can review it:

  • the PR description's HUMAN: section needs at least 20 characters describing what you tested, not just the template placeholder

Push an update once this is addressed and this check re-runs automatically.

This is an automated check - no AI was used to generate this comment.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new tests cannot import github_client in a clean checkout because its shared-client directory is not added to sys.path.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates github-repo-monitor to honor the configured AUTOMATION_MODEL profile, with fallback to the active profile.

Changes:

  • Adds profile resolution through the Agent API.
  • Adds fallback handling for unset or missing profiles.
  • Adds regression tests for profile selection.
File summaries
File Description
tests/test_github_repo_monitor.py Adds tests for profile resolution and fallback behavior.
skills/github-repo-monitor/scripts/main.py Resolves profiles and forwards the selected LLM configuration.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +16 to +20
def load_repo_monitor_helpers():
source = SCRIPT_PATH.read_text(encoding="utf-8")
namespace: dict = {"__name__": "repo_monitor_main"}
exec(compile(source, str(SCRIPT_PATH), "exec"), namespace)
return namespace
@onatozmenn

Copy link
Copy Markdown
Author

Regarding the github_client import concern: no sys.path hack is needed. The repo's pyproject.toml already sets pythonpath = ["python", "skills/github/scripts"] (supported natively since pytest 7; CI runs pytest 8), and the real module lives at skills/github/scripts/github_client.py — the file next to the script is just a symlink to it. The tests import and pass in a clean checkout (python -m pytest tests/test_github_repo_monitor.py -q → 3 passed), same as the existing test_slack_channel_monitor.py pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR reviewer and repo monitor skills ignore AUTOMATION_MODEL — automations run on the active profile, not their configured one

3 participants