Skip to content

Tools skip next - #1196

Merged
isamu merged 2 commits into
receptron:mainfrom
isamu:toolsSkipNext
Aug 13, 2025
Merged

isamu merged 2 commits into
receptron:mainfrom
isamu:toolsSkipNext

Conversation

@isamu

@isamu isamu commented Aug 13, 2025 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Improved tool agent flow control to correctly skip LLM responses when a skip indicator is present, preventing unintended LLM invocations and ensuring expected copy-through behavior.
  • Tests
    • Updated test coverage to reflect the new skip-based behavior and validate end-to-end tool handling.
  • Chores
    • Bumped package version to 1.0.2.
    • Switched to a real test runner for more reliable test execution.

@coderabbitai

coderabbitai Bot commented Aug 13, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Renamed the gating flag from hasNext to skipNext across the tools agent flow, updated conditional wiring to use skipNext, adjusted tests accordingly, and bumped the package version with a real test script. No public APIs changed.

Changes

Cohort / File(s) Summary of changes
Gating semantics update
llm_agents/tools_agent/src/tools_agent.ts, llm_agents/tools_agent/lib/tools_agent.js
Replace hasNext with skipNext in graph nodes; invert gating: toolsResponseLLM runs unless :skipNext; skipToolsResponseLLM runs if :skipNext. Introduce skipNext node reading array items’ skipNext booleans.
Tests aligned to new flag
llm_agents/tools_agent/tests/test_tools.ts
Update tool stubs and expectations: add skipNext: true for getWeather; remove hasNext from textSpeach; adjust assertions.
Package updates
llm_agents/tools_agent/package.json
Bump version 1.0.1 → 1.0.2; replace placeholder test script with Node test runner using ts-node.

Sequence Diagram(s)

sequenceDiagram
  actor Caller
  participant ToolsAgent
  participant Graph
  participant SkipNextNode
  participant toolsResponseLLM
  participant skipToolsResponseLLM

  Caller->>ToolsAgent: invoke
  ToolsAgent->>Graph: run pipeline
  Graph->>SkipNextNode: evaluate skipNext from toolsAgentResponse[]
  alt skipNext = false
    Graph->>toolsResponseLLM: execute (unless :skipNext)
  else skipNext = true
    Graph->>skipToolsResponseLLM: execute (if :skipNext)
  end
  Graph-->>Caller: result
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • add test #1187 — Also modifies tools agent behavior around the per-tool “next” flag; this PR aligns by renaming and rewiring to skipNext.

Poem

I twitch my whiskers at a toggle’s plight,
From hasNext’s dawn to skipNext’s night.
Now paths diverge with clearer cue,
One hops ahead, one hops askew.
Version bumped, tests squeak “true!”—
A happy rabbit signs “toodaloo!” 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5889f80 and 2a60e2c.

📒 Files selected for processing (4)
  • llm_agents/tools_agent/lib/tools_agent.js (2 hunks)
  • llm_agents/tools_agent/package.json (2 hunks)
  • llm_agents/tools_agent/src/tools_agent.ts (2 hunks)
  • llm_agents/tools_agent/tests/test_tools.ts (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
llm_agents/tools_agent/lib/tools_agent.js (2)
agents/vanilla_agents/lib/bundle.cjs.js (8)
  • namedInputs (279-279)
  • namedInputs (744-744)
  • namedInputs (1211-1211)
  • namedInputs (2655-2655)
  • namedInputs (2932-2932)
  • namedInputs (3013-3013)
  • namedInputs (4033-4033)
  • namedInputs (4260-4260)
agents/vanilla_agents/lib/bundle.umd.js (8)
  • namedInputs (280-280)
  • namedInputs (745-745)
  • namedInputs (1212-1212)
  • namedInputs (2656-2656)
  • namedInputs (2933-2933)
  • namedInputs (3014-3014)
  • namedInputs (4034-4034)
  • namedInputs (4261-4261)
🔇 Additional comments (11)
llm_agents/tools_agent/package.json (2)

3-3: Version bump looks appropriate for this change.

The version increment from 1.0.1 to 1.0.2 is appropriate for this internal API change that renames the gating flag from hasNext to skipNext.


15-15: Good improvement to the test script.

Replacing the placeholder "echo nothing" with a proper test runner enables actual execution of the TypeScript tests in the repository.

llm_agents/tools_agent/src/tools_agent.ts (3)

105-112: Semantic improvement with skipNext gating logic.

The rename from hasNext to skipNext provides clearer semantic meaning - it's more intuitive that skipNext: true means "skip the next LLM call" rather than the previous ambiguous hasNext flag.


115-115: Correct conditional logic for skipNext flag.

Using unless: ":skipNext" correctly ensures the LLM response flow only executes when no tool agent requests to skip the next step.


133-133: Proper complement to the LLM flow condition.

Using if: ":skipNext" correctly implements the alternative path when tools request to skip the LLM response, creating a clear branching logic.

llm_agents/tools_agent/tests/test_tools.ts (3)

14-14: Test correctly reflects skipNext semantics.

The test properly demonstrates that getWeather returns skipNext: true to indicate it wants to skip the subsequent LLM call.


17-21: Correct removal of skipNext flag for textSpeach.

The textSpeach function correctly omits the skipNext flag, meaning it will proceed with the normal LLM flow after tool execution.


205-205: Test expectation correctly updated for skipNext.

The test expectation properly includes skipNext: true for the getWeather tool response, which aligns with the new semantics.

llm_agents/tools_agent/lib/tools_agent.js (3)

105-107: JavaScript implementation correctly matches TypeScript source.

The compiled JavaScript correctly implements the skipNext logic with ele.skipNext property access, matching the TypeScript source.


115-115: Conditional logic properly translated to JavaScript.

The unless: ":skipNext" condition is correctly preserved in the compiled JavaScript, maintaining the intended flow control.


133-133: Complementary condition correctly implemented.

The if: ":skipNext" condition is properly implemented to handle the skip path when tools request to bypass the LLM response.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@isamu
isamu merged commit 9dfdef9 into receptron:main Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant