Skip to content

fix(taskctl): hardcoded repo 'randomm/opencode' in executeStart causes wrong issue fetch #355

@randomm

Description

@randomm

Bug

taskctl start <issueNumber> hardcodes const repo = "randomm/opencode" in job-commands.ts line 120. When running the opencode binary in a different project (e.g., sammas), it fetches issue content from randomm/opencode instead of the actual repo, causing the Composer to generate wrong tasks.

Root cause

packages/opencode/src/tasks/job-commands.ts line 120:

const repo = "randomm/opencode"

Fix

Detect the repo from git remote of cwd:

const remoteResult = await $`git remote get-url origin`.cwd(cwd).quiet().nothrow()
const remoteUrl = new TextDecoder().decode(remoteResult.stdout).trim()
// parse github.com/owner/repo from SSH or HTTPS remote URL
const repo = parseGithubRepo(remoteUrl) ?? "randomm/opencode"

Parse both formats:

  • git@github.com:owner/repo.gitowner/repo
  • https://github.com/owner/repo.gitowner/repo

Acceptance Criteria

  • taskctl start fetches the issue from the repo where the binary is running, not a hardcoded value
  • Falls back gracefully if remote detection fails
  • Existing tests pass

Quality Gates

  • TDD: tests before implementation
  • Linting passes
  • Local verification: all tests pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions