Skip to content

Add Everhour estimate generator for GitHub issues#4302

Open
Copilot wants to merge 6 commits into
mainfrom
copilot/automate-estimation-for-issues
Open

Add Everhour estimate generator for GitHub issues#4302
Copilot wants to merge 6 commits into
mainfrom
copilot/automate-estimation-for-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 25, 2026

Automated estimation system that uses GitHub Models inference to estimate GitHub issues, writes estimates to Everhour, and supports manual corrections via /estimate Nh commands.

Changes

Everhour API Client (src/everhour/)

  • Custom TypeScript wrapper with auth, retries, error normalization
  • Estimate category ↔ hours ↔ seconds mappings with Zod validation

Estimation Engine (src/estimation/)

  • loadInstructions.ts / loadSamples.ts — loads prompt corpus from .github/instructions/estimate/
  • buildPrompt.ts — assembles instructions + samples + issue into model prompt
  • callGitHubModel.ts — calls gpt-4o-mini via GitHub Models with retry
  • validateEstimate.ts — strict schema validation with 3-attempt retry, hard fail

Workflows (.github/workflows/)

  • estimate-issue-opened.yml — triggers on issues: [opened], skips empty bodies
  • estimate-command.yml — triggers on /estimate Nh comments, validates hours, checks commenter trust, updates Everhour immediately, opens PR with sample
  • backfill-everhour-estimates.ymlworkflow_dispatch with limit and dry_run inputs, traverses Everhour project tasks → missing estimates → GitHub issues → inference

Scripts (scripts/)

  • estimate-issue.ts / estimate-command.ts / backfill-everhour-estimates.ts

Tests (28 passing)

  • Schema validation, prompt assembly, command parsing, hour/category mapping, trusted-commenter guard, empty-body skip

Usage

# Backfill (dry run)
EVERHOUR_API_KEY=... EVERHOUR_PROJECT_ID=gh:143808059 LIMIT=10 DRY_RUN=true yarn estimate:backfill

# Manual correction (via issue comment)
/estimate 4h

Valid estimate values: 1h (XXS), 2h (XS), 4h (S), 8h (M), 16h (L), 24h (XL), 48h (XXL).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ofcncog2cu-dsn.algolia.net
    • Triggering command: /opt/hostedtoolcache/node/22.22.3/x64/bin/node node /home/REDACTED/work/_temp/ghcca-node/node/bin/yarn add -D tsx zod (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add Everhour estimate generator for GitHub issues Add Everhour estimate generator for GitHub issues May 25, 2026
Copilot AI requested a review from raineorshine May 25, 2026 18:47
@raineorshine raineorshine marked this pull request as ready for review May 26, 2026 19:51
@raineorshine
Copy link
Copy Markdown
Contributor

@copilot I found the following issue in the estimate:backfill script:

Skipping task "Doubly-linked Items" - cannot extract issue number

Copilot AI and others added 2 commits May 27, 2026 19:05
…ogging

Co-authored-by: raineorshine <750276+raineorshine@users.noreply.github.com>
…ogging

Co-authored-by: raineorshine <750276+raineorshine@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 27, 2026

@copilot I found the following issue in the estimate:backfill script:

Skipping task "Doubly-linked Items" - cannot extract issue number

Fixed in the latest commit. extractIssueNumber now tries three strategies in order:

  1. Task IDgh:REPO_ID:ISSUE_NUMBER (existing)
  2. foreignId field — numeric string some Everhour API versions return for GitHub-linked tasks (new)
  3. #NUMBER anywhere in the task name — previously only matched ^#(\d+)\s at the start; now matches /#(\d+)/ anywhere (e.g. "Fix bug (#123)")

Tasks like "Doubly-linked Items" that have no GitHub issue number at all will still be skipped, but the log message now includes the task ID to make it easier to identify these: Skipping task "Doubly-linked Items" (manual) - no GitHub issue number found.

8 new unit tests added in src/everhour/__tests__/extractIssueNumber.ts.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Everhour Estimate Generator for GitHub Issues

2 participants