Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

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

Ouverte
#104 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
69/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
node.js, typescript
Domaine
backend, compilers

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.
Langage dominant
TypeScript
Étoiles
274
Forks
56
Merge moyen
12 h 18 min
PR mergées (30 j)
5

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de salesforce/agentscript

Toutes les issues de salesforce/agentscript

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.