GitLab stations ignore the automation's agent profile on a local Agent Server

Open Beginner friendly
#969 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start by reading skills/gitlab-issue-to-mr/scripts/main.py and skills/gitlab-mr-reviewer/scripts/common.py, then compare the local conversation setup with the GitHub stations' agent_conversation.py and the cloud path. Check how AUTOMATION_AGENT_PROFILE_ID is passed to the Agent Server. Done when all three affected GitLab stations use the selected profile when set and retain current behavior without one.

Written by the indexing model from the issue text.

Description

What happens

On a local Agent Canvas, I created the three GitLab stations with an agent profile that uses Claude Code over ACP. When gitlab-issue-to-mr picks up a labelled issue, the conversation starts with the default Agent and the model from Settings → LLM, not the selected profile. With no API key there, the run fails on its first message:

litellm.AuthenticationError: AuthenticationError: OpenAIException - ... Incorrect API key provided: None.

This is the local counterpart of #848, which fixed the same problem on OpenHands Cloud and Enterprise.

Cause

On the local path, create_conversation() in skills/gitlab-issue-to-mr/scripts/main.py builds {"kind": "Agent", "llm": <settings LLM>} and never reads AUTOMATION_AGENT_PROFILE_ID. Only the cloud path passes agent_profile_id.

_start_conversation() in skills/gitlab-mr-reviewer/scripts/common.py has the same pattern, so gitlab-mr-reviewer and gitlab-prd-refiner are affected too.

The automation service sets AUTOMATION_AGENT_PROFILE_ID for local runs as well, and the Agent Server accepts agent_profile_id when it starts a conversation. The GitHub stations already use it locally through agent_conversation.py.

Proposed fix

When AUTOMATION_AGENT_PROFILE_ID is set, send agent_profile_id instead of a hand-built agent. Without a profile, keep the current behaviour.

Related

github-agents-md-maintainer and github-repo-monitor use the same pattern on the local path. I'd leave them for a follow-up so this fix stays focused on GitLab.

Environment

Local Agent Canvas (Docker), openhands-agent-server 1.62.0, extensions main at cfd1d0f.

Dominant language
Python
Stars
184
Forks
137
Avg merge
1d 16h
Merged PRs (30d)
60

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenHands/extensions

All issues in OpenHands/extensions

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.