bug: get_run_details has returned a non-progressing zero-limit cursor since PR #3224

オープン 初心者向け
#4,733 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@AbhayPratap01 がすでに取り組んでいます。

2026年8月25日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
api

調査の方向性

packages/cli-v3/src/mcp/schemas.ts(GetRunDetailsInput、maxTraceLines に最小値がない)と、readLinesPage が nextCursor を offset + limit として計算する packages/cli-v3/src/mcp/tools/runs.ts から始める。スキーマに正の整数の制約を追加し、さらに readLinesPage に防御的なチェックを追加して、0 または負の limit に対してはエラーを返すか、進むカーソルを返すようにする。既存の cli-v3 MCP ツールのテストで検証し、maxTraceLines に 0、負の値、1 のケースを追加して、nextCursor が "0" から "1" へ進むことを確認する。

索引モデルが issue の本文から書いたものです。

説明

Provide environment information

System:
  OS: macOS 26.5.2
  CPU: (10) arm64 Apple M4
  Memory: 1.82 GB / 16.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 24.19.0
  npm: 11.7.0
  pnpm: 11.19.0
  bun: 1.3.14
Trigger.dev:
  CLI and SDK: 4.5.11
  MCP transport: stdio
  Flags: --dev-only --readonly
  Environment: dev

Describe the bug

The MCP get_run_details tool accepts maxTraceLines: 0 and reports a
successful empty page with nextCursor: "0". Following that cursor requests
the same page again, so pagination cannot advance.

I found this while testing Trigger.dev's MCP surface with an internal agent
compatibility system at Bottomless. The reproduction is model-free and uses a
dedicated benchmark dev project.

Expected behavior: reject a page size below one, or return a cursor that
advances.

Actual behavior:

Run Trace (lines 1-0 of 43)
More trace available.
nextCursor: "0"

To reproduce

  1. Start the official Trigger.dev MCP for a project that has a completed dev
    run.
  2. Call get_run_details for that run with maxTraceLines: 0.
  3. Observe that the call succeeds, reports lines 1-0, and returns cursor
    "0" while saying more trace is available.
  4. Call the tool again with cursor "0"; it returns the same page.

Reduced arguments:

{
  "projectRef": "<project-ref>",
  "environment": "dev",
  "runId": "<completed-run-id>",
  "maxTraceLines": 0
}

A control call with maxTraceLines: 1 returns lines 1-1 and cursor "1".

Additional information

I traced the behavior through Main history. The non-progressing cursor path was
introduced by PR #3224,
feat(cli): Expand and improve the MCP server and dev CLI command, merged on
March 17, 2026 at commit
dbbe9f77f953ad7a8306e48d7bd1107e3f8d3ba2.

Before that PR, maxTraceLines existed but get_run_details did not return a
cursor. PR #3224 added cursor pagination while leaving the zero value valid.
Its new readLinesPage function computed nextCursor as offset + limit, so
a zero limit returned the same cursor indefinitely.

The schema still accepted every integer when I rechecked Main on August 20,
2026 at 447471843cbe7759f64beb616d5db5f05696ea13, because maxTraceLines has
no minimum:

https://github.com/triggerdotdev/trigger.dev/blob/447471843cbe7759f64beb616d5db5f05696ea13/packages/cli-v3/src/mcp/schemas.ts#L146-L160

The same cursor calculation also remains on current Main:

https://github.com/triggerdotdev/trigger.dev/blob/447471843cbe7759f64beb616d5db5f05696ea13/packages/cli-v3/src/mcp/tools/runs.ts#L35-L52

Suggested change: require a positive integer in GetRunDetailsInput, add a
defensive positive-limit check in readLinesPage, and cover zero/negative
limits plus a one-line positive case in tests.

The live check had zero invalid cases, unchanged fixture state, and verified
cleanup. Searches of existing issues and PRs found no matching report. This is
an MCP response-contract issue, not a security report.

We are testing a system at Bottomless that runs repeatable MCP contract and
workflow checks, verifies the observed behavior directly, and can replay the
same checks when an MCP changes. We are trying to learn whether MCP teams would
want checks like this on future pull requests or releases. Would that be useful
to your team?

If useful, I can look into a focused regression test and fix, then rerun the
same check.

主要言語
TypeScript
スター
16.5k
フォーク
1.5k
平均マージ
1日 15時間
マージ済み PR(30日)
17

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

triggerdotdev/trigger.dev のほかの issue

triggerdotdev/trigger.dev の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。