Skip to main content
← Back to list
01Issue
BugClosedSwamp CLI
Assigneesstack72

#185 CEL expression evaluator throws 'Unhandled node type: string'

Opened by bixu · 4/29/2026

Description

When evaluating CEL expressions in workflow step inputs or model globalArguments, swamp occasionally throws an error with the message:

Unhandled node type: string

Steps to Reproduce

This error surfaces intermittently during:

  • swamp workflow evaluate or swamp workflow validate on workflows containing CEL expressions with string concatenation (e.g. ${{ env.HOME + "/.swamp/deno:" + env.PATH }})
  • Workflow runs that reference step outputs via ${{ data.latest(...).attributes.outputs }}

The exact triggering command has not been consistently isolated, but it appears tied to CEL expressions that involve string-typed values or string-typed node types in the expression AST.

Environment

  • swamp version: 20260428.142235.0
  • Platform: macOS (darwin 25.4.0)

Expected Behavior

CEL expressions containing string-typed nodes should evaluate without error.

Actual Behavior

The evaluator throws Unhandled node type: string and the command fails.

02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED+ 1 MOREASSIGNEDCLASSIFICATION

Closed

4/30/2026, 1:41:17 PM

No activity in this phase yet.

03Sludge Pulse
stack72 assigned stack724/29/2026, 8:52:50 PM
Editable. Press Enter to edit.

stack72 commented 4/29/2026, 9:11:32 PM

Thanks for filing this @bixu. I tried to reproduce against swamp 20260427.121812.0 (sha 2b3d12ed) and could not trigger Unhandled node type: string along any code path I exercised. Summary of what I tried:

1. Direct evaluator probes (38 expressions). I called CelEvaluator.evaluate with every string-typed pattern I could enumerate: pure string concat, the exact env example from this report (env.HOME + "/.swamp/deno:" + env.PATH), data.latest("m","d").attributes.outputs (and .outputs.stdout, .outputs["stdout"]), string() coercion, string functions (size, startsWith, contains, split, substring, matches, endsWith), comparisons (<, ==), ternaries on strings, has() on string fields, map/filter/all/exists macros over string lists, and string-keyed map literals. 37/38 evaluated cleanly. The single failure was "foo".replace("o","0") — an unrelated cel-js limitation ("found no matching overload"), not "Unhandled node type".

2. End-to-end workflow run. I built a workflow with run: '${{ "echo " + "hello" + " " + "world" }}', registered a command/shell model, and ran swamp workflow run. Step succeeded. The expression was evaluated correctly through the full workflow pipeline.

3. workflow evaluate and workflow validate against the same workflow both succeed.

4. Test suite. All 53 tests in src/infrastructure/cel/cel_evaluator_test.ts pass.

5. Source search. The literal string "Unhandled node type" (and the partials Unhandled, node type, nodeType) does not appear anywhere in:

  • src/ (swamp source)
  • @marcbachmann/[email protected] — parser, evaluator, type-checker, operators, macros, functions

The closest CEL errors that do exist are "Unsupported type: ${type}" (operators.js:65) and "Unknown AST operation: ${op}" (serialize.js:100) — neither matches the reported message.

To move this forward, I need:

  • A verbatim stack trace showing the file/line where the error originates. The reported text doesn't appear in our code or in cel-js, so without a trace I can't identify the offending path.
  • The exact command and the exact workflow / model YAML that produced the error.
  • swamp version (the report says 20260428.142235.0 — please confirm, and ideally re-run on a current binary via swamp update with --log-level=debug).
  • Could the error have come from a different tool wrapping swamp (an editor extension, a separate cel-evaluate CLI, a wrapper script) and been misattributed?

Given how critical CEL is to swamp, I'd rather over-investigate than close this prematurely — but I also can't plan a fix without being able to reach the failing code path.

bixu commented 4/30/2026, 9:41:25 AM

Fair. We'll try to get you more information if it happens again.

bixu commented 4/30/2026, 9:54:57 AM

It's probably https://github.com/anthropics/claude-code/issues/42085 -- I vote we close this issue.

stack72 commented 4/30/2026, 1:41:09 PM

thanks for that @bixu - I wasn't aware of that issue. That definitely feels what it is :) I will close it out!

Sign in to post a ripple.