Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[feat] import --from-mr: include the MR's review threads in the extraction

Open
#1,187 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@scpia is already working on this.

Since Oct 16, 2026.

  • #1190 by @scpia — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
github, typescript
Domain
cli

Research direction

Start with the MR fetchers in src/providers/gitlab/mr-fetch.ts and the GitHub path that runs gh pr view, then extractMRLearningPrompt, which receives the title, description, commits and diff. Linked PR #1190 is already open against this work, so check it before starting. Done means threads are fetched on both providers, system and teamai CI notes are filtered out, the prompt gets a separate budgeted thread section, and --no-discussions keeps the old behaviour.

Written by the indexing model from the issue text.

Description

Problem

On our team the review threads of a merge request carry most of what is worth keeping. A reviewer points at a line and names the problem and a fix, the author answers, and the thread ends with a decision. That is the material a learning should be made of.

teamai import --from-mr does not read them. The GitLab fetcher (src/providers/gitlab/mr-fetch.ts) reads the MR, /commits and /changes; the GitHub fetcher runs gh pr view --json title,body,author,mergedAt,commits. extractMRLearningPrompt then receives the title, the description, the commit subjects and the first 3000 characters of the diff. For an MR whose value is in its review, the learning comes out as a summary of the diff, and the decision from the thread is missing. Checked on 0.27.0 and on main (fe3b906).

Proposed Solution

  1. Fetch the threads:
    • GitLab: GET /projects/:id/merge_requests/:iid/discussions, paginated.
    • GitHub: review comments (/pulls/:n/comments), review bodies (/pulls/:n/reviews) and conversation comments (/issues/:n/comments).
    • TGit: the notes endpoint teamai ci already uses.
  2. Leave out system notes and teamai's own <!-- teamai:ci-extract comments, so the CI extraction does not feed its own output back in.
  3. Give the threads their own section in the prompt with its own size budget: per thread the file and line it is anchored to, whether it is resolved, and the notes in order, each marked as MR author or reviewer. Threads with a reply come first and single unanswered remarks last; a long thread is shortened instead of the section being cut off in the middle.
  4. Tell the model that a decision in a resolved thread outweighs a restatement of the diff.
  5. On by default, with --no-discussions for the current behaviour.

Alternatives Considered

  • An agent reads the threads through an MCP server and writes a learning with teamai contribute --file. That works, but every team rebuilds the fetch, the duplicate check and the publish path that import --from-mr already has.
  • Asking authors to copy the outcome of the review into the MR description before the import. That depends on discipline and loses the file and line context.

Additional Context

  • #1122 (several MR URLs per run) makes this useful for working through a backlog of merged MRs.
  • Separate from this request but in the same function: the prompt requires Chinese output (【必须】用中文撰写). A team that keeps its learnings in English gets Chinese learnings from import --from-mr and has no way to change that. Following the language of the existing learnings, or a setting such as sharing.learnings.language, would fix it. I can open a separate issue for it if you prefer.
  • Environment: teamai 0.27.0, self-managed GitLab, single-repo mode.
Dominant language
TypeScript
Stars
5.5k
Forks
443
Avg merge
20h 8m
Merged PRs (30d)
340

Getting set up

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 Tencent/teamai-cli

All issues in Tencent/teamai-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.