Skip to content

feat(jira): let JIRA_ISSUE_GET page back to older comments - #7886

Merged
viktormarinho merged 1 commit into
mainfrom
feat/jira-issue-get-older-comments
Oct 13, 2026
Merged

viktormarinho merged 1 commit into
mainfrom
feat/jira-issue-get-older-comments

Conversation

@viktormarinho

@viktormarinho viktormarinho commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What is this contribution about?

renderIssueForPrompt is used by both a Jira run's opening message and JIRA_ISSUE_GET. It gives its 12k comment budget to the newest comments, which is the right default. Older ones are dropped with a [… N older comments omitted] marker, and nothing could read them: a run had no way to page back. In practice, anything that lives in an old comment is out of reach. For example, a card's acceptance criteria said where the test account was, and two runs in a row were blocked on it.

This change:

  • JIRA_ISSUE_GET takes an optional commentsBefore: number. The rendering then shows only the first N comments of the thread, oldest first, with the same budget, under a ## Comments (1–N of T) heading.
  • When comments are hidden, the rendering names the exact value to pass: To read the earlier comments, call JIRA_ISSUE_GET with `commentsBefore: K`. This line also appears in a run's opening message, so the run learns about the parameter where it hits the limit.
  • If the oldest comment shown was clipped to fit the budget, the next page ends right after it, so it is read whole there. The exception is a single comment that alone exceeds the budget: it stays clipped and paging does not loop on it.
  • No change when the thread fits. The batch digest (renderIssuesForPrompt) is untouched.

How did you verify your code works?

  • bun test apps/api/src/jira/issue-prompt.test.ts: 16 pass. The existing budget tests are unchanged. 5 new tests:
    • the default page names the commentsBefore that reaches the hidden comments;
    • following the named values from the newest page back reaches the first comment, with every comment rendered whole exactly once and the value strictly decreasing;
    • a paged window is labelled 1–N of T and keeps the rest of the issue;
    • a single oversized comment does not produce a page that would not move;
    • a value past the end of the thread is clamped.
  • bun run verify: 10573 pass, 0 fail.
  • bun run check: exit 0.
  • Not run: a live JIRA_ISSUE_GET against a real Jira thread on this build.

How to Test

  1. Pick an issue whose comments add up to more than 12k characters.
  2. Call JIRA_ISSUE_GET with its key. The result says [… N older comments omitted] and names a commentsBefore value.
  3. Call it again with that value. You get the older comments, under ## Comments (1–K of T). Repeat until no value is named.

Review Checklist

  • PR title is clear and descriptive
  • Changes are tested and working
  • Documentation is updated (if needed)
  • No breaking changes

Summary by cubic

Lets JIRA_ISSUE_GET page back through a long comment thread. The 12k comment budget always went to the newest comments and older ones were dropped with an omitted marker, with no way to read them; now the tool takes an optional commentsBefore that renders only the first N comments, oldest first.

  • When older comments are hidden or the oldest shown one was clipped, the result names the exact commentsBefore value to call next, so a run can page back and read each comment whole once.
  • A single comment exceeding the budget stays clipped and paging does not loop on it.
  • The batch digest and threads that fit in the budget are unchanged.

Written for commit 4d1e0fb. Summary will update on new commits.

View guided diff Turn on auto-fix

The issue rendering gives its 12k comment budget to the newest comments
and only says "[… N older comments omitted]". A run had no way to read
those, so anything that lived in an old comment, like a test account a
card points to, was out of reach.

JIRA_ISSUE_GET takes `commentsBefore`: render only the first N comments
of the thread, with the same budget. When older comments are hidden or
the oldest shown one is clipped, the rendering names the value that
reaches them, so a run can page back to the first comment and read each
one whole once (a single comment over the budget stays clipped).
@viktormarinho
viktormarinho enabled auto-merge (squash) October 13, 2026 16:28
@viktormarinho
viktormarinho merged commit cbba276 into main Oct 13, 2026
33 checks passed
@viktormarinho
viktormarinho deleted the feat/jira-issue-get-older-comments branch October 13, 2026 16:29
decocms Bot pushed a commit that referenced this pull request Oct 13, 2026
PR: #7886 feat(jira): let JIRA_ISSUE_GET page back to older comments
Bump type: minor

- decocms (apps/api/package.json): 4.468.0 -> 4.469.0
- @decocms/native (apps/native/package.json): 4.468.0 -> 4.469.0

Deploy-Scope: server
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.

1 participant