Skip to content

Commit a9efaa6

Browse files
committed
Merge remote-tracking branch 'upstream/main' into chore/merge-main-into-lv-2026-07-15
# Conflicts: # agent/src/pipeline.py # cdk/src/constructs/ecs-agent-cluster.ts # cdk/src/constructs/ecs-payload-bucket.ts # cdk/src/handlers/fanout-task-events.ts # cdk/src/handlers/shared/strategies/ecs-strategy.ts # cdk/src/handlers/shared/workflows.ts # cdk/src/stacks/agent.ts # cdk/test/constructs/ecs-agent-cluster.test.ts # cdk/test/handlers/shared/create-task-core.test.ts # cdk/test/handlers/shared/strategies/ecs-strategy.test.ts # cdk/test/handlers/shared/workflows.test.ts
2 parents a85ec68 + 22705e8 commit a9efaa6

26 files changed

Lines changed: 2563 additions & 204 deletions

agent/src/jira_reactions.py

Lines changed: 407 additions & 46 deletions
Large diffs are not rendered by default.

agent/src/pipeline.py

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
resolve_linear_api_token,
2626
)
2727
from context import assemble_prompt, fetch_github_issue
28-
from jira_reactions import comment_task_finished, comment_task_started
28+
from jira_reactions import (
29+
comment_task_started,
30+
transition_pr_opened,
31+
transition_task_started,
32+
)
2933
from linear_reactions import react_task_finished, react_task_started
3034
from models import AgentResult, HydratedContext, RepoSetup, TaskConfig, TaskResult
3135
from observability import current_otel_trace_id, task_span
@@ -995,6 +999,17 @@ def _on_trace_truncated(max_bytes: int, first_dropped: int) -> None:
995999
config.channel_metadata,
9961000
)
9971001

1002+
# Move the Jira card To Do → In Progress so the board reflects that
1003+
# work has started (issue #572). No-op for non-Jira tasks.
1004+
# Best-effort; failures are logged and never block the pipeline.
1005+
# Part of the Early-ACK block (moved before setup_repo with the 👀
1006+
# and start comment) so board state updates immediately, not after
1007+
# the multi-minute baseline build.
1008+
transition_task_started(
1009+
config.channel_source,
1010+
config.channel_metadata,
1011+
)
1012+
9981013
# Setup repo (deterministic pre-hooks). A failure/timeout/OOM in the
9991014
# pre-agent baseline build raises here; it needs no local handler —
10001015
# the outer ``except Exception`` at the bottom of this ``try`` writes
@@ -1327,6 +1342,14 @@ def _on_trace_truncated(max_bytes: int, first_dropped: int) -> None:
13271342
post_span.set_attribute("pr.url", pr_url or "")
13281343
if pr_url:
13291344
progress.write_agent_milestone("pr_created", pr_url)
1345+
# Move the Jira card In Progress → In Review now that a PR is
1346+
# open (issue #572). Only fires when a PR was actually opened —
1347+
# failed / no-PR tasks leave the card where humans can see the
1348+
# failure comment. No-op for non-Jira tasks; best-effort.
1349+
transition_pr_opened(
1350+
config.channel_source,
1351+
config.channel_metadata,
1352+
)
13301353

13311354
# Memory write — capture task episode and repo learnings
13321355
memory_written = False
@@ -1388,14 +1411,14 @@ def _on_trace_truncated(max_bytes: int, first_dropped: int) -> None:
13881411
transition_state=linear_transition_state,
13891412
)
13901413

1391-
# Terminal status comment on the Jira issue (REST shim, with the
1392-
# PR link when one was opened). No-op for non-Jira tasks.
1393-
comment_task_finished(
1394-
config.channel_source,
1395-
config.channel_metadata,
1396-
success=(overall_status == "success"),
1397-
pr_url=pr_url,
1398-
)
1414+
# NOTE: the terminal status comment on the Jira issue is NOT posted
1415+
# here. Since issue #573 the deterministic fan-out plane
1416+
# (``cdk/src/handlers/fanout-task-events.ts`` ``dispatchToJira``)
1417+
# owns the Jira final-status comment — it carries cost/turns/
1418+
# duration and, crucially, fires even if this agent crashes before
1419+
# reaching this point (max-turns, OOM). Posting here too would
1420+
# double-comment. The agent still posts the *start* comment
1421+
# (``comment_task_started`` above) for in-flight progress.
13991422

14001423
# --trace trajectory S3 upload (design §10.1). Runs AFTER
14011424
# post-hooks but BEFORE ``write_terminal`` so the resulting
@@ -1570,14 +1593,11 @@ def _on_trace_truncated(max_bytes: int, first_dropped: int) -> None:
15701593
success=False,
15711594
started_reaction_id=linear_eyes_reaction_id,
15721595
)
1573-
# Best-effort failure comment on the Jira issue. No-op for
1574-
# non-Jira tasks; network failures are swallowed.
1575-
comment_task_finished(
1576-
config.channel_source,
1577-
config.channel_metadata,
1578-
success=False,
1579-
pr_url=None,
1580-
)
1596+
# NOTE: no Jira failure comment here — the fan-out plane's
1597+
# ``dispatchToJira`` (issue #573) owns the Jira terminal comment
1598+
# and fires on the platform side even when this crash path runs,
1599+
# so posting here would double-comment. (Contrast the Linear ❌
1600+
# reaction above, which the fan-out plane does not replicate.)
15811601
raise
15821602

15831603

0 commit comments

Comments
 (0)