Skip to content

fix(workflows): an agent step's turn no longer waits on its issue tracker - #49582

Merged
juliusmarminge merged 3 commits into
pingdotgg:mainfrom
Kamo2323:fix/workflow-issue-link-off-start
Dec 5, 2026
Merged

juliusmarminge merged 3 commits into
pingdotgg:mainfrom
Kamo2323:fix/workflow-issue-link-off-start

Conversation

@Kamo2323

@Kamo2323 Kamo2323 commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Problem

Part of #39013, which lists:

Issue linking runs on the deadline path, before the turn and its start time are recorded: link separately, with a bound.

An agent step given issue reads that issue from its tracker and links the thread to it inside WorkflowAgents.start. The step records its thread and turn (stepThread) and takes its start time only after start returns (workflowAgent.ts). The tracker read has no time limit. So:

  • a slow tracker delays when the step shows its thread and when its timeout starts counting;
  • a tracker that never answers leaves the step waiting even after its agent's turn has ended.

Change

  • showIssue in WorkflowAgentThreads.ts now runs in the background, forked into the service's scope, so start returns as soon as the turn is sent.
  • The read and link are given up after 30 seconds, with the same warning a failing tracker already logs.
  • The background fiber keeps the step's context, so the issue is still recorded as something the step touched.
  • If the server restarts or the engine is rebuilt while a link is still pending, the link is dropped and a warning says so. Before, the step had not recorded its turn yet, so start ran again on resume and linked then. That window is now one tracker round trip, at most 30 seconds.

Scope

A bug fix for one item of #39013. #39013 is a list of follow-ups, so this PR doesn't close it.

Not changed: steps on a linked environment, which don't pass issue on, and corrections, which call start again and so link again. Both work as before.

Verification

Test kept: "starts a step's turn without waiting on its issue tracker, and gives up on it" in runtimeLayer.test.ts, next to the reply test from #48614. It guards a stuck step, which the keep bar names. It continues a real thread with an issue whose tracker never answers, checks that start returns the turn, then moves the test clock 30 seconds and checks that the read was given up.

On main's source the test never gets past start. To see it, from this branch, put main's WorkflowAgentThreads.ts back and run the test with a short timeout:

git checkout e7a610766f -- apps/server/src/workflows/WorkflowAgentThreads.ts
vp test run apps/server/src/orchestration-v2/runtimeLayer.test.ts -t "without waiting on its issue tracker" --testTimeout=10000
git checkout HEAD -- apps/server/src/workflows/WorkflowAgentThreads.ts
FAIL  |t3| src/orchestration-v2/runtimeLayer.test.ts > workflow agent replies > starts a step's turn without waiting on its issue tracker, and gives up on it
TestTimeoutError: Test timed out in 10000ms.
      Tests  1 failed | 159 skipped (160)

With the fix: Tests 1 passed | 159 skipped (160). The whole describe block passed 3 runs out of 3.

Context check. A fiber forked with Effect.forkIn still sees services provided around the fork (Effect 4.2.0), so noteReference inside issues.read still reaches the step's StepReferences:

forked fiber sees: step-references

Checks. vp run check:changed passed:

  • format, lint, knip, graphql and typecheck (3 packages)
  • tests (2 files): 162 passed

Not checked. No real-server run. That would need a real issue tracker that never answers. The test above uses the real thread code with only the tracker replaced.

Windows 11, Node 24.19.0, Effect 4.2.0.

Claude Opus 5.5 in Claude Code, run from T3 Code. An independent Claude Opus 5.5 review found no bugs. Its two suggestions are applied: the warning when a pending link is stopped, and a test that waits for the read to start before moving the clock.

🤖 Generated with Claude Code

Kamo2323 and others added 2 commits December 5, 2026 20:03
…cker

An agent step with `issue` read the issue from its tracker and linked the thread before
`start` returned. The step records its thread and turn, and starts its timeout, only after
`start` returns, so a slow tracker delayed both, and a tracker that never answered left the
step waiting after its agent had finished.

The issue is now read and linked in the background, and given up after 30 seconds, with the
same warning as a tracker that fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A restart or engine rebuild while the link waits on the tracker drops it, since the step already
recorded its turn. Log that, and have the test wait for the read before moving the clock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Dec 5, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 72434fa

Macroscope's review found this PR approvable — Workflow agents no longer wait for optional issue linking before returning their turn. Linking remains best-effort, with a 30-second timeout and logging; agent launch settings and external issue contents are unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 72434fa and fc8ea17.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Issue linking now runs in the captured Effect scope and has a 30-second timeout. A test verifies that workflow startup returns before the issue read completes and that the read is interrupted after the timeout.

Changes: Issue-link timeout

Layer / File(s) Summary
Issue-link timeout and regression test
apps/server/src/workflows/WorkflowAgentThreads.ts, apps/server/src/orchestration-v2/runtimeLayer.test.ts
showIssue forks issue linking into the captured scope, applies a 30-second timeout, and logs when linking is interrupted. The test setup reuses extracted mock dependencies. A new test verifies that WorkflowAgents.start returns before an issue read completes and that the read is interrupted after 30 seconds.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge, stienswout

Merge Risk: Minimal · previous review 72434

Workflow agent steps no longer wait on the issue tracker before their turn is recorded, and a slow link is abandoned after 30 seconds. A link still pending during a restart is dropped, which the change documents. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: an agent step's turn no longer waits on its issue tracker. The raw summary and objectives confirm that issue linking now runs in the background with a 30-second bound,…
Description check Passed The description follows the template well. It has Problem, Change, Scope and Verification sections, each with specific content. The Problem section explains the blocking behavior and links #39013. The…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: an agent step's turn no longer waits on its issue tracker. The raw summary and objectives confirm that issue linking now runs in the background with a 30-second bound, so the title matches the primary change. It uses the conventional commit format from the template.

Full details: Description check

Explanation

The description follows the template well. It has Problem, Change, Scope and Verification sections, each with specific content. The Problem section explains the blocking behavior and links #39013. The Change section lists the 30-second bound, the warning, the retained context, and the restart behavior. Scope states what is not changed. Verification gives a kept test, the exact commands to reproduce the failure on main, observed results, and what was not checked. The template's closing line asks for the model and harness used, and the description includes it.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9c66c4d and 72434fa.

Files selected for processing: 2

  • apps/server/src/orchestration-v2/runtimeLayer.test.ts
  • apps/server/src/workflows/WorkflowAgentThreads.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 5, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Environment: Linux web, Chromium 156, 1280×800, light theme; fresh databases, real Linear test team, Replay multi-turn.

Steps: connect Linear and bind project app; run tracker-stall (agent fix, one-minute timeout, issue link, then code step after) with requests passing through as a control; hold only T3Issue open in a forwarding proxy; run again and observe after 90 seconds.

Scenario: A completed workflow agent advances while Linear's issue read is held open

Proven: the scenario fails on base ca4dd71a32 and passes on head fc8ea17197.

Base ca4dd71a32 Head fc8ea17197
Result ❌ failed
ASSERTION_FAILED: expected "running" to be "completed"
✅ passed
workflow with tracker held open Base ca4dd71a32: workflow with tracker held open Head fc8ea17197: workflow with tracker held open
failure Base ca4dd71a32: failure
Recording Before recording After recording

Scenario driver · Runtime observations and timeout warning

Base: the agent thread completed, but the workflow remained running with no step thread attached after 90 seconds. Head: the thread was attached and both steps completed in 901ms; the optional issue read logged a 30-second timeout. Real Linear requests passed in both control runs; test issues were archived afterward.

Not shown:

  • A deadline firing for an agent that itself runs longer than one minute was not exercised: Replay completed quickly. The reproduced failure was the completed agent being blocked by its issue read.
  • Cancellation during server shutdown was not exercised; the optional read's 30-second timeout and warning were observed.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 5, 2026
@juliusmarminge
juliusmarminge merged commit 0432c3e into pingdotgg:main Dec 5, 2026
56 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 5, 2026
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Dec 6, 2026
**v0.1.15-nightly.20261205.5786** · 61 changes from 12 contributors

- **Large file previews.** Load remote files that exceed the automatic preview limit.
- **Project-specific MCP servers.** Import configurations with the same name and command but different credentials or headers.
- **GitHub issue forms.** Use issue templates with numeric or boolean options and empty optional fields.
- **Cursor text generation.** Generate commit messages, branch names, and thread titles with Cursor again.
- **Workflow reasons.** Unsent workflow question reasons now survive an environment reconnect.
- **Shared worktree protection.** Deleting a thread no longer removes a worktree another thread started using during confirmation.

### Plus 53 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(server): stopping Codex during startup no longer loses its accepted turn by @StiensWout in pingdotgg/t3code#49435
* fix(workflows): open invoked runs from older workflows by @UtkarshUsername in pingdotgg/t3code#49437
* fix(web): omit inverted line range on empty file reads by @only21mil in pingdotgg/t3code#49452
* perf(server): t3 --version no longer loads the whole CLI by @juliusmarminge in pingdotgg/t3code#49461
* fix(preview): let users load oversized files by @Yash-Singh1 in pingdotgg/t3code#49470
* fix(mobile): a saved draft waits for a project choice when its project is removed by @StiensWout in pingdotgg/t3code#49455
* fix(client-runtime): file previews refresh when a background command finishes late by @StiensWout in pingdotgg/t3code#49458
* fix(server): fixed-time scheduled tasks interrupted before dispatch no longer skip the slot by @taogezhizun in pingdotgg/t3code#49417
* perf(web): reuse the read-only file preview cache key by @UtkarshUsername in pingdotgg/t3code#49464
* fix(shared): thread find no longer matches across line breaks in user HTML by @only21mil in pingdotgg/t3code#49449
* fix(web): ignore Shift and Alt on prompt stash delete shortcut by @only21mil in pingdotgg/t3code#49473
* fix(server): failed updates no longer lose recent data when the database is symlinked by @StiensWout in pingdotgg/t3code#49459
* fix(shared): relative file links with ../ resolve to the normalized path by @juliusmarminge in pingdotgg/t3code#49479
* fix(test): VcsStatusBroadcaster checkout test no longer flakes when HEAD.lock events arrive apart by @t3dotgg in pingdotgg/t3code#49494
* fix(server): fresh-session task waits while its previous occurrence awaits background work by @juliusmarminge in pingdotgg/t3code#49490
* fix(server): finish force stop when the target run settles by @UtkarshUsername in pingdotgg/t3code#49486
* perf(client-runtime): recording a thread open no longer replaces quiet thread shells by @shivamhwp in pingdotgg/t3code#49475
* perf(server): Read saved previews for live workflow lists by @UtkarshUsername in pingdotgg/t3code#49484
* fix(server): commit on new branch waits for a multi-repository worktree thread by @StiensWout in pingdotgg/t3code#49482
* fix(web): only capture keybindings while recording a SnapShot shortcut by @only21mil in pingdotgg/t3code#49489
* fix(web): ignore extra modifiers on workflow editor save shortcut by @only21mil in pingdotgg/t3code#49506
* fix(server): SSH readiness check retries after an interrupted response by @StiensWout in pingdotgg/t3code#49512
* fix(web): importing an MCP server keeps other projects' configurations available by @StiensWout in pingdotgg/t3code#49516
* fix(web): ignore Shift, Alt, and IME composition on spreadsheet copy by @only21mil in pingdotgg/t3code#49520
* fix(web): Word previews handle malformed links and spaced internal parts by @only21mil in pingdotgg/t3code#49519
* fix(shared): byte sizes just under the next unit no longer read "1024 KB" by @dev-dami in pingdotgg/t3code#49524
* fix(server): connecting during a checkout keeps the current Git status by @StiensWout in pingdotgg/t3code#49526
* fix(server): keep content search highlights and whole-word matches accurate on non-UTF-8 lines by @only21mil in pingdotgg/t3code#49535
* fix(web): image annotation shortcuts ignore extra modifiers and work with CapsLock by @only21mil in pingdotgg/t3code#49534
* fix(web): show the linked workflow run in All runs by @UtkarshUsername in pingdotgg/t3code#49543
* fix(provider-core): surface Codex managed requirements rejections for granular approval policies by @vibecodooor in pingdotgg/t3code#49540
* fix(web,mobile): choosing a question option sets an image-only answer aside by @juliusmarminge in pingdotgg/t3code#49517
* fix(server): MCP PR review comments preserve the old path on renamed files by @only21mil in pingdotgg/t3code#49557
* fix(server): creating a missing workflow helper makes its workflow load by @StiensWout in pingdotgg/t3code#49562
* fix(github): accept YAML scalars and empty keys in issue templates by @only21mil in pingdotgg/t3code#49558
* fix(server): a stalled cancellation cleanup no longer holds up other workflows' timeouts by @StiensWout in pingdotgg/t3code#49561
* fix(mobile): Usage cache savings ratio uses the app language's decimal separator by @tiliakoos in pingdotgg/t3code#49560
* fix(server): restarting after a pool place is given back keeps the requested resume by @StiensWout in pingdotgg/t3code#49567
* fix(server): retrying a failed project action save now saves it by @StiensWout in pingdotgg/t3code#49573
* fix(server): client connections no longer start Xwayland on Linux by @juliusmarminge in pingdotgg/t3code#49596
* fix(mobile-nitro): Android draft screen matches React Native's header, font and composer by @juliusmarminge in pingdotgg/t3code#49441
* fix(workflows): an agent step's turn no longer waits on its issue tracker by @Kamo2323 in pingdotgg/t3code#49582
* fix(mobile-nitro): a list shows its new rows at once when all of them are replaced on Android by @juliusmarminge in pingdotgg/t3code#49454
* fix(mobile-nitro): Android text fields are readable in dark mode by @juliusmarminge in pingdotgg/t3code#49466
* fix(web): unsent workflow reasons survive an environment reconnect by @StiensWout in pingdotgg/t3code#49603
* fix(server): service install after uninstall no longer refuses as a downgrade by @juliusmarminge in pingdotgg/t3code#49611
* fix(web): deleting a thread keeps a worktree another thread started using by @StiensWout in pingdotgg/t3code#49599
* fix(web,mobile): voice model benchmarks use the app language's decimal separator by @tiliakoos in pingdotgg/t3code#49581
* fix(cursor): Cursor text generation uses Composer 2.5 instead of the retired Composer 2 by @juliusmarminge in pingdotgg/t3code#49614
* fix(mobile-nitro): iOS text inputs use the app theme's colors by @juliusmarminge in pingdotgg/t3code#49509
* fix(mobile-nitro): Android survives Activity recreation (blank screen, colour scheme crash) by @juliusmarminge in pingdotgg/t3code#49572
* fix(mobile-nitro): a tap on a markdown link opens it, and thread links open their thread by @juliusmarminge in pingdotgg/t3code#49546
* fix(server): device access error says the setting is in desktop or web settings by @juliusmarminge in pingdotgg/t3code#49616
* fix(server): OpenCode commands no longer stay running after a failed status check by @StiensWout in pingdotgg/t3code#49602
* feat(mobile-nitro): user message links, thread chips and mentions match React Native by @juliusmarminge in pingdotgg/t3code#49569
* fix(mobile-nitro): Android markdown draws chips, mentions and quoted links like iOS by @juliusmarminge in pingdotgg/t3code#49590
* fix(mobile): guide file links open hidden test files by @StiensWout in pingdotgg/t3code#49600
* fix(server): workflows retry an engine that did not start after a reload by @StiensWout in pingdotgg/t3code#49563
* fix(mobile-nitro): choosing another project drops the draft's pull request by @StiensWout in pingdotgg/t3code#49597
* fix(mobile): pull request diffs no longer mix revisions after reconnecting by @StiensWout in pingdotgg/t3code#49607

## New Contributors
* @dev-dami made their first contribution in pingdotgg/t3code#49524
* @vibecodooor made their first contribution in pingdotgg/t3code#49540

**Full Changelog**: pingdotgg/t3code@v0.1.14-nightly.20261205.5772...v0.1.15-nightly.20261205.5786

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.15-nightly.20261205.5786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants