Skip to content

πŸ› contribute: open the contributor's PR against upstream, and say so when it lands in the fork - #18844

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/contributor-pr-upstream-repo
Nov 17, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/contributor-pr-upstream-repo

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

A contributor agent working from a fork can open its fix PR inside its own fork. Both the head and the base are then in the fork, so the hive never sees the fix.

  • Prompt: the task prompt now names the upstream repo for gh pr create.
  • Relay: when the relay finds this task's PR in the agent's fork, it tells the agent once to reopen it upstream. It used to drop the URL without a word.

What happened

On projectbluefin/chairlift#798, all times Eastern on 11-17:

The same fork has two older PRs of the same kind, kylerankin/chairlift#1 and #2.

Cause

The prompt never named the base repo. buildTaskPromptBodyWithHintsAndIssueRead (contribute_task_prompt.go):

  • tells a fork-working agent only to "open a PR from your fork", plus gh pr create --base <b> when a base is declared;
  • tells it to reuse a clone left by a prior task.

Without --repo, gh takes the base repo from the clone, and a reused clone can default to the fork. The self-check asked only about the base branch, so a PR on fork:main passed it.

The relay dropped the PR silently. detectPRURLs (bin/contributor-relay.js) skips any URL outside the task repo. That rule is right: a PR in another repo is never this task's PR. But it skipped the agent's own misplaced PR with no log and no message to the agent.

What changed

Prompt (contribute_task_prompt.go)

  • From a fork: gh pr create --repo <upstream> --head <your-login>:<your-branch>, with the login read via gh api user --jq .login. This is the same shape as the reference-repo path in pkg/scheduler/kickmessage.go.
  • With push access: gh pr create --repo <upstream>.
  • Both are used together with any --base named earlier in the prompt. The prompt also says why: a reused clone may default to the fork.
  • Both self-checks (declared base and fallback) now ask the agent to confirm the PR URL starts with https://github.com/<upstream>/pull/.

Relay (bin/contributor-relay.js)

Docs: src/docs/contributor-relay.md, plus a changelog fragment.

Not in this PR

  • Closing or moving existing fork PRs. That's the contributor's job.
  • gh repo fork, clone reuse and base resolution are unchanged.
  • No new task_complete field. The relay tells the agent while it can still act, instead of reporting the PR to the hub after the fact.

Tests

Only gofmt -l was run for Go (AGENTS.md bans local go test/go build/go vet); CI runs the Go tests. node bin/contributor-relay.test.js was run locally: the three new tests pass. The same 78 tests also fail on unmodified v6 on this host for environment reasons (753/831 there, 756/834 with this change, identical failure list).

No existing issue or PR covers this. Searches for "PR opened against fork", "gh pr create --repo", "fork instead of upstream", "set-default", "detectPRURLs" and three other phrasings found only #18198, the reference-repo fork path this follows.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

…when it lands in the fork

The task prompt never named the base repo for gh pr create, so a clone
reused across tasks that defaults to the fork opened the PR fork-to-fork
(projectbluefin/chairlift#798 -> kylerankin/chairlift#3). The relay
rightly never credited that PR but dropped it silently.

The prompt now names --repo <upstream> (and --head <login>:<branch> from
a fork) and asks the agent to confirm the upstream PR URL. The relay
tells the agent once to reopen a PR found in its own fork, as the task
would finalize or before the stall backstop fails a frozen pane.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 17, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18836 πŸ› contribute: an unverified already-done verdict no longer leaves hive/already-done on the issue same files bin/contributor-relay.js
bin/contributor-relay.test.js
src/docs/contributor-relay.md
#18841 πŸ› contribute: offer wrong_base only with a vN base; a park keeps the agent's reason same files src/docs/contributor-relay.md
src/pkg/dashboard/contribute_task_prompt.go

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#18844846259a` sha256:c2572264cb7c09eaf29ab4ad9456a7484346c0b178ee77db75ee689959f2ce68 β€” download from the dashboard or `hivectl review evidence #18844`.

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

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant