Summary
DevClaw can route GitHub tracker operations to the wrong repository when a project is configured against a fork but the local checkout has mixed origin / upstream remotes.
The problem is broader than task_create alone.
In this environment, the devclaw project is registered against yaqub0r/devclaw, but GitHub operations have drifted toward laurentenhoor/devclaw when ambient gh repository inference was allowed to win over project configuration.
The real bug appears to be that GitHub tracker operations do not consistently use the configured project repository as the single source of truth.
Expected behavior
If the DevClaw project entry points to a specific GitHub repository, all GitHub tracker operations should target that configured repository.
For this project, GitHub tracker operations should target:
and should never drift to:
unless that upstream repo is explicitly configured for the project.
Actual behavior
Observed drift has included at least:
task_create creating an issue on:
laurentenhoor/devclaw#529
- downstream tracker paths later failing against upstream instead of the configured fork, for example:
HTTP 404: Not Found (https://api.github.com/repos/laurentenhoor/devclaw/labels)
- follow-up regression from an over-broad fix attempt:
task_comment failed: unknown flag: --repo
So the failure mode is not just “issue creation went to the wrong repo”.
It is a broader repository-targeting contract problem inside the GitHub provider.
Environment details
Project registry entry:
- workspace
devclaw/projects.json shows repoRemote: https://github.com/yaqub0r/devclaw
Local git remotes in /home/sai/git/devclaw:
origin = https://github.com/yaqub0r/devclaw.git
upstream = https://github.com/laurentenhoor/devclaw.git
Important clue from the affected environment:
gh repo view in that checkout resolved to upstream rather than the fork
This means ambient GitHub CLI repo inference in the checkout can prefer upstream even though the DevClaw project registry points at the fork.
Reproduction
- Register/link a DevClaw project whose configured GitHub target is a fork, for example
yaqub0r/devclaw.
- Use a local checkout whose git remotes include both:
origin = fork
upstream = canonical upstream
- Ensure ambient GitHub CLI repo inference resolves to upstream rather than the configured fork.
- Run GitHub-backed DevClaw tool paths.
- Observe tracker operations can drift to upstream or fail because they are targeting the wrong repo.
Current understanding of scope
This issue should be treated as a GitHub provider targeting problem, not only a task_create bug.
Potentially affected GitHubProvider behavior includes:
- issue creation
- issue reads / edits / closes / reopens
- label management and transition paths
- issue comments
- PR listing / merge / diff / status helper paths
- reactions
- GraphQL repo lookup paths
- attachment upload paths
The underlying contract should be:
the configured project repo is the source of truth for all GitHub tracker operations
and DevClaw should not rely on ambient checkout-based gh repo inference when project config already specifies the tracker target.
Likely root cause
The GitHub issue/provider path appears to rely too heavily on ambient gh repository inference instead of consistently deriving the target repo from registered project configuration.
There is also an important command-family distinction:
gh issue, gh pr, gh label, and gh repo can use command-specific explicit repo targeting
gh api must not be treated exactly the same way as gh issue / gh pr
A blanket “append --repo everywhere” fix is not correct.
Recommended fix
In the GitHub provider layer:
- resolve the target repo from the registered project config
- thread that target explicitly through GitHub provider operations
- do not rely on checkout-context inference once project config specifies the repo
- implement explicit targeting in a command-family-aware way
- ensure
gh api paths use a valid explicit-targeting strategy rather than inheriting gh issue / gh pr flag behavior
Acceptance criteria
- the configured project repo is the single source of truth for GitHub tracker routing
- mixed
origin / upstream remotes do not cause tracker-routing drift
task_create creates issues on the configured project repo
- label-management / transition paths use the configured project repo
- representative issue-comment and PR-related provider paths use the configured project repo
- no GitHub provider path relies on ambient checkout repo inference when project config already specifies the repo
gh api paths are handled with a valid explicit-targeting strategy and do not fail from invalid --repo injection
Summary
DevClaw can route GitHub tracker operations to the wrong repository when a project is configured against a fork but the local checkout has mixed
origin/upstreamremotes.The problem is broader than
task_createalone.In this environment, the
devclawproject is registered againstyaqub0r/devclaw, but GitHub operations have drifted towardlaurentenhoor/devclawwhen ambientghrepository inference was allowed to win over project configuration.The real bug appears to be that GitHub tracker operations do not consistently use the configured project repository as the single source of truth.
Expected behavior
If the DevClaw project entry points to a specific GitHub repository, all GitHub tracker operations should target that configured repository.
For this project, GitHub tracker operations should target:
yaqub0r/devclawand should never drift to:
laurentenhoor/devclawunless that upstream repo is explicitly configured for the project.
Actual behavior
Observed drift has included at least:
task_createcreating an issue on:laurentenhoor/devclaw#529HTTP 404: Not Found (https://api.github.com/repos/laurentenhoor/devclaw/labels)task_comment failed: unknown flag: --repoSo the failure mode is not just “issue creation went to the wrong repo”.
It is a broader repository-targeting contract problem inside the GitHub provider.
Environment details
Project registry entry:
devclaw/projects.jsonshowsrepoRemote: https://github.com/yaqub0r/devclawLocal git remotes in
/home/sai/git/devclaw:origin = https://github.com/yaqub0r/devclaw.gitupstream = https://github.com/laurentenhoor/devclaw.gitImportant clue from the affected environment:
gh repo viewin that checkout resolved to upstream rather than the forkThis means ambient GitHub CLI repo inference in the checkout can prefer upstream even though the DevClaw project registry points at the fork.
Reproduction
yaqub0r/devclaw.origin = forkupstream = canonical upstreamCurrent understanding of scope
This issue should be treated as a GitHub provider targeting problem, not only a
task_createbug.Potentially affected GitHubProvider behavior includes:
The underlying contract should be:
and DevClaw should not rely on ambient checkout-based
ghrepo inference when project config already specifies the tracker target.Likely root cause
The GitHub issue/provider path appears to rely too heavily on ambient
ghrepository inference instead of consistently deriving the target repo from registered project configuration.There is also an important command-family distinction:
gh issue,gh pr,gh label, andgh repocan use command-specific explicit repo targetinggh apimust not be treated exactly the same way asgh issue/gh prA blanket “append
--repoeverywhere” fix is not correct.Recommended fix
In the GitHub provider layer:
gh apipaths use a valid explicit-targeting strategy rather than inheritinggh issue/gh prflag behaviorAcceptance criteria
origin/upstreamremotes do not cause tracker-routing drifttask_createcreates issues on the configured project repogh apipaths are handled with a valid explicit-targeting strategy and do not fail from invalid--repoinjection