Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug] Bare `transition to` after a reasoning action's `set` lines is silently dropped (no handoff, no diagnostic)

オープン
#104 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

まだ誰も着手していません。

評価

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

調査の方向性

Start in packages/compiler/src/nodes/compile-tool.ts, especially compileConditionalBody, then compare how the compiler handles a top-level post-action TransitionStatement with one inside an if. Use the reproduction through compile(parseSource(...)) from packages/compiler/test/test-utils.ts and check diagnostics and the compiled handoff fields. Done when the transition is compiled as a handoff or an unsupported top-level transition produces a diagnostic.

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

説明

Description

A transition to @subagent.X written directly in a reasoning action's post-action block (after with / set lines) compiles with no diagnostics but emits no handoff. The same transition wrapped in an if is compiled correctly. Authors get a script that validates cleanly and then never performs the transition at runtime.

From reading packages/compiler/src/nodes/compile-tool.ts, TransitionStatement appears to be handled only inside conditional bodies (compileConditionalBody), with no handler or warning for a top-level transition in the post-action block.

Found while fixing trailheadapps/agent-script-recipes#107, where the "Bidirectional Navigation" recipe never returned from the specialist subagent.

Steps to Reproduce

Compile this with @agentscript/compiler (the repro below is a throwaway vitest file using compile(parseSource(...)) from packages/compiler/test/test-utils.ts):

config:
    developer_name: "Repro"
    agent_label: "Repro"
    agent_type: "AgentforceEmployeeAgent"
    description: "repro"

variables:
    result: mutable string = ""

start_agent router:
    description: "router"
    reasoning:
        instructions: ->
            | route
        actions:
            go: @utils.transition to @subagent.specialist

subagent hub:
    description: "hub"
    reasoning:
        instructions: ->
            | hub

subagent specialist:
    description: "specialist"
    actions:
        analyze:
            description: "analyze"
            inputs:
                q: string
                    description: "q"
                    is_required: True
            outputs:
                out: string
                    description: "out"
            target: "flow://Analyze"
    reasoning:
        instructions: ->
            | specialist
        actions:
            run_analyze: @actions.analyze
                with q="x"
                set @variables.result = @outputs.out
                transition to @subagent.hub

Expected Behavior

Either the transition compiles to a handoff (as it does inside an if), or the compiler reports a diagnostic that a top-level transition to is not supported in a post-action block.

Actual Behavior

Post-action block diagnostics post_tool_call after_all_tool_calls hub referenced in node
transition to @subagent.hub [] absent absent no
if @outputs.out: then transition to @subagent.hub [] present present yes

The compiled specialist tool carries only the set state updates. The hosted Agent API compile endpoint (/einstein/ai-agent/v1.1/authoring/scripts) returns the same shape, and in a live preview the agent stayed in the specialist subagent after the action ran.

Environment

  • Node.js version: 22.22.3
  • pnpm version: 10.34.6
  • OS: macOS (Darwin 25.6.0)
  • Package & version: @agentscript/compiler 3.26.1 (repo commit ace15eb, built from source)

Additional context

  • Related docs gap: examples in downstream recipe repos show a bare post-action transition to as valid, so authors reasonably write it.
  • Separate from this issue: even the if-guarded form, which compiles correctly, did not perform the handoff in one live hosted preview. That looks like a runtime question, not a compiler one, and is not part of this report.
  • Workaround that works at runtime: move the transition to the subagent's after_reasoning block, guarded on a stored variable.
主要言語
TypeScript
スター
274
フォーク
56
平均マージ
12時間 18分
マージ済み PR(30日)
5

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

salesforce/agentscript のほかの issue

salesforce/agentscript の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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