Skip to content

fix(nodes): stop four nodes passing raw input downstream (#2304 to stage) - #2352

Merged
asclearuc merged 1 commit into
stagefrom
fix/stage-preventDefault
Sep 18, 2026
Merged

asclearuc merged 1 commit into
stagefrom
fix/stage-preventDefault

Conversation

@asclearuc

Copy link
Copy Markdown
Collaborator

Summary (stage port)

  • context_optimizer, summarization, tool_guild and tool_n8n returned normally from lane handlers whose input lane is also an output lane. So the engine also forwarded the raw input: the untrimmed question next to the trimmed one, the full text next to the summary, and the raw input next to the Guild / n8n result.
  • Each affected handler now ends in return self.preventDefault(), after its own work. The false "overriding suppresses raw passthrough" docstrings in tool_guild and tool_n8n are corrected.
  • Added delivery-count tests for every changed handler, and a first unit-test file for summarization. Existing tests that call these handlers directly now require the PreventDefault exception.

Type

fix

Testing

  • Tests added or updated
  • Tested locally: 791 tests pass under the engine interpreter (test_lane_forward_once_nodes.py, test_tool_guild.py, test_tool_n8n.py, context_optimizer/, summarization/, test_sys_modules_guard.py, test_contracts.py), and 104 pass under plain Python. With the node changes reverted, 36 of those tests fail. ruff format and ruff check are clean.
  • ./builder test passes: not run (it needs the full build and a server). The nodes were not run on a live engine.

Checklist

  • Commit messages follow conventional commits
  • No secrets or credentials included
  • Wiki updated (if applicable): n/a, the node READMEs already describe only the node's own output
  • Breaking changes documented (if applicable): n/a, the raw passthrough was never documented. None of the shipped pipelines that use these nodes relies on it (examples/guild-agent.pipe, examples/n8n-roundtrip.pipe, examples/n8n/*.pipe, packages/server/test/pipelines/advrag-ingest.json)

Linked Issue

Fixes #2303

Related: #1638 (memory_persistent, PR #1682), #1985 (prompt, PR #1992), #2041

🤖 Generated with Claude Code

After a Python lane handler returns normally, the engine also forwards the handler's input on the same lane. Only `preventDefault()` stops that. Four nodes returned normally, so downstream received the raw input next to the node's own output.

- `context_optimizer`: both exits of `writeQuestions` now end in `return self.preventDefault()`. Downstream no longer gets the untrimmed original next to the trimmed question.
- `summarization`: `writeText` and `writeTable` collect the text, then suppress the forward. Only the summary from `closing()` goes on.
- `tool_guild`: `writeText`, `writeQuestions` and `writeDocuments` collect, then suppress. The docstring claiming "overriding suppresses raw passthrough" is corrected.
- `tool_n8n`: the same for `writeText`, `writeQuestions`, `writeDocuments`, and every `writeImage` / `writeAudio` / `writeVideo` chunk.
- Missing docstrings added in the four node files.

Tests:

- `test_lane_forward_once_nodes.py`: delivery-count cases for every changed handler.
- New `summarization/test_summarization.py`: the node had no unit tests.
- `context_optimizer/test_all.py` and `test_tool_n8n.py`: direct handler calls now require the `PreventDefault` exception.
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • develop
  • release/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 5a275a7e-ef0b-466b-8f14-61d5ef652502

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the module:nodes Python pipeline nodes label Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor
🤖 Internal: Discord sync marker

Auto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete.

@asclearuc
asclearuc merged commit 23133b5 into stage Sep 18, 2026
17 of 19 checks passed
@asclearuc
asclearuc deleted the fix/stage-preventDefault branch September 18, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:nodes Python pipeline nodes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant