Tool Result Passing as Arguments (Tool Chaining)#2304
Conversation
tim-inkeep
commented
Feb 24, 2026
- Agents can pass saved artifacts directly to tools as arguments using a sentinel reference; the system resolves full artifact data (including non-preview fields) before the tool executes — no manual reconstruction needed
- Agents can chain tool calls by piping the raw output of one tool directly into the next without creating an artifact for intermediate results; primitive return types (strings, numbers, booleans) are fully supported
- Fixed in-session artifact cache key mismatch that caused getArtifactFull to return the wrong data structure for same-turn artifacts
- Improved artifact creation prompting to clearly distinguish what artifact:create captures (all fields), what artifact:ref displays (preview only), and what tool argument passing resolves (all fields)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 60934c4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
PR Review Summary
(8) Total Issues | Risk: High
🔴❗ Critical (1) ❗🔴
🔴 1) ArtifactService.ts:654 Error object created but never thrown
Issue: An error object is constructed with new Error(...) but is never thrown. The code immediately logs and returns, allowing artifacts to be saved with missing required fields.
Why: This completely defeats the validation logic. Artifacts missing required fields will be saved to the database and potentially cause downstream failures when consumers expect those fields to exist. This is a silent data integrity bug that will be very hard to diagnose in production.
Fix: Add throw before the new Error(...):
throw new Error(
`Cannot save artifact: Missing required fields [${summaryValidation.missingRequired.join(', ')}] ` +
...
);Refs:
Inline Comments:
- 🔴 Critical:
ArtifactService.ts:660Error created but never thrown — validation is ineffective
🟠⚠️ Major (4) 🟠⚠️
🟠 1) function-tools.mdx Documentation missing sentinel reference syntax
Issue: The new tool chaining feature allows agents to pass tool results directly as arguments using sentinel references ({ "$tool": "call_id" } or { "$artifact": "id", "$tool": "call_id" }), but this syntax is not documented in the function tools documentation.
Why: Developers won't know this feature exists or how to use it. The PR description mentions this as a key feature ("chain tool calls by piping the raw output of one tool directly into the next"), but there's no documentation for SDK users to discover or learn it.
Fix: Add a new section to function-tools.mdx documenting:
- The sentinel reference syntax for tool chaining
- When to use
$toolvs$artifact + $toolpatterns - How primitive return types are handled
- Example showing a pipeline where one tool's output feeds into another
Refs:
🟠 2) ArtifactService.test.ts Missing test coverage for cache key fix
Issue: The PR description mentions fixing an "in-session artifact cache key mismatch that caused getArtifactFull to return the wrong data structure for same-turn artifacts." This is a critical bugfix, but there's no dedicated test case covering the cache key change from data to full.
Why: Without a regression test, this bug could easily be reintroduced. The cache key naming (summary/full vs summary/data) is subtle and the consequences are severe (wrong data returned to tools).
Fix: Add a test in ArtifactService.test.ts that:
- Saves an artifact in the same turn
- Retrieves it via
getArtifactFull - Verifies the correct data structure is returned (not the summary)
Refs:
- ArtifactService.test.ts
- ArtifactService.ts:558-561 — cache storage
- ArtifactService.ts:758-762 — cache retrieval
🟠 3) ArtifactService.test.ts Missing tests for getArtifactFull fallback chain
Issue: The getArtifactFull method has a complex fallback chain (in-memory cache → database with type schema validation → raw JSON fallback), but there are no tests covering these paths or the new getToolResultRaw method.
Why: These are the core methods enabling tool chaining. Without test coverage, regressions in the fallback logic could silently break tool-to-tool data passing.
Fix: Add tests covering:
getArtifactFullcache hit pathgetArtifactFulldatabase fallback with schema validationgetArtifactFullraw JSON fallbackgetToolResultRawreturning stored tool resultsgetToolResultRawreturning undefined for missing results
Refs:
🟠 4) agents-cli Missing changeset for major CLI refactoring
Issue: The PR includes a significant refactoring from pull-v3 to pull-v4 in the CLI (moving from LLM-based merging to ts-morph AST-based generation), but there's no changeset for agents-cli. The only changeset is deep-mugs-start.md which covers agents-api with a vague message.
Why: Users of agents-cli won't see any changelog entry for this major change. The pull command behavior may change significantly with the AST-based approach.
Fix: Create a changeset for agents-cli:
pnpm bump minor --pkg agents-cli "Refactor pull command to use ts-morph for deterministic AST-based code generation instead of LLM-based merging"Refs:
Inline Comments:
- 🟠 Major:
deep-mugs-start.md:5Vague changeset — should describe sentinel references and cache fix
🟡 Minor (3) 🟡
🟡 1) IncrementalStreamParser.ts:80 Empty catch block hides initialization failures
Issue: When getting the shared ArtifactService, errors are silently swallowed with an empty catch block.
Why: If getArtifactService throws (e.g., due to misconfiguration), the parser will silently fall back to creating a new instance, potentially causing inconsistent behavior that's hard to debug.
Fix: Log the error at debug/warn level before falling back.
Refs:
Inline Comments:
- 🟡 Minor:
IncrementalStreamParser.ts:80Empty catch block — add debug logging - 🟡 Minor:
ArtifactParser.ts:285Empty catch block — add debug logging for JSON parse failures
🟡 2) visual-builder/tools/function-tools.mdx Missing cross-reference to tool chaining
Issue: The Visual Builder function tools documentation doesn't mention tool chaining capabilities.
Why: Users configuring tools via the UI won't discover that their tools can be chained together.
Fix: Add a brief section or note referencing the TypeScript SDK documentation for tool chaining patterns.
Refs:
🟡 3) ArtifactService.ts Primitive wrapper asymmetry
Issue: The wrapPrimitiveResult method wraps strings/booleans with { text: ..., _toolCallId } but numbers with { value: ..., _toolCallId }. This inconsistency could confuse consumers.
Why: Downstream code must handle both text and value properties depending on the primitive type.
Fix: Consider using a consistent property name (e.g., value for all primitives) or document the asymmetry clearly.
Refs:
💭 Consider (3) 💭
💭 1) ArtifactParser.ts Explicit type for sentinel references
Issue: The sentinel reference patterns ({ $artifact, $tool } and { $tool }) are checked via runtime property access but have no TypeScript type definition.
Fix: Consider adding a discriminated union type for sentinel references to improve type safety and documentation.
💭 2) scope-helpers.ts Database query timeout consideration
Issue: The scope helpers construct complex SQL queries that could be slow on large datasets.
Fix: Consider adding query timeouts or pagination for production safety.
💭 3) PromptConfig.ts Schema display consolidation
Issue: The system prompt constructs artifact schemas inline with template literals spanning many lines.
Fix: Consider extracting schema formatting to a helper function for maintainability.
💡 APPROVE WITH SUGGESTIONS
Summary: This PR introduces valuable tool chaining capabilities via sentinel references ({ "$tool": "call_id" } and { "$artifact": "id", "$tool": "call_id" }), along with a CLI refactoring to use ts-morph. However, there's a critical bug where validation errors are created but never thrown (ArtifactService.ts:654), which must be fixed before merge. Additionally, the new tool chaining feature needs documentation, and the cache key bugfix needs regression tests to prevent reintroduction. The CLI changeset is also missing.
Discarded (9)
| Location | Issue | Reason Discarded |
|---|---|---|
PromptConfig.ts |
Missing artifact lifecycle docs | Already documented in artifact-components.mdx |
scope-helpers.ts |
Schema changes without migration | No schema changes detected, just helper refactoring |
pull-v4/ |
Missing integration tests | Has comprehensive unit test coverage via snapshots |
ArtifactParser.ts |
Silent fallback on unresolved refs | Intentional design — fallback allows graceful degradation |
streaming.ts |
Missing timeout on stream operations | Out of scope for this PR |
slack/blocks |
Citation block accessibility | Out of scope, pre-existing pattern |
github/mcp |
Branch protection bypass risk | Tool properly checks permissions, no bypass |
nango.ts |
Credential exposure risk | Uses existing secure patterns |
utility.ts |
Type changes could break consumers | Changes are additive/internal |
Reviewers (12)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
pr-review-errors |
8 | 1 | 0 | 0 | 2 | 0 | 5 |
pr-review-devops |
8 | 1 | 0 | 0 | 1 | 0 | 6 |
pr-review-sre |
7 | 0 | 1 | 0 | 0 | 0 | 6 |
pr-review-consistency |
7 | 1 | 0 | 0 | 0 | 0 | 6 |
pr-review-llm |
6 | 0 | 1 | 0 | 0 | 0 | 5 |
pr-review-tests |
5 | 2 | 0 | 0 | 0 | 0 | 3 |
pr-review-docs |
5 | 2 | 0 | 0 | 0 | 0 | 3 |
pr-review-product |
5 | 0 | 0 | 0 | 0 | 0 | 5 |
pr-review-breaking-changes |
4 | 0 | 0 | 0 | 0 | 0 | 4 |
pr-review-types |
4 | 0 | 1 | 0 | 0 | 0 | 3 |
pr-review-architecture |
4 | 0 | 0 | 0 | 0 | 0 | 4 |
pr-review-standards |
0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Total | 63 | 7 | 3 | 0 | 3 | 0 | 50 |
| "@inkeep/agents-api": patch | ||
| --- | ||
|
|
||
| Updated artifact parsing |
There was a problem hiding this comment.
🟠 MAJOR: Changeset message too vague for significant feature
Issue: "Updated artifact parsing" doesn't communicate the user-facing impact. This PR introduces tool result chaining ({ "$tool": "call_id" } syntax), fixes artifact cache key issues, and improves prompting clarity — none of which is communicated.
Why: Per CLAUDE.md, changesets should "be specific about what changed and why it matters to consumers." Developers reading changelogs need to understand the new capabilities and behavior changes.
Fix:
| Updated artifact parsing | |
| Add tool result chaining to pipe raw tool outputs directly into subsequent tool calls. Improve artifact prompting to clarify which fields are captured, displayed, and passed to tools. |
Refs:
There was a problem hiding this comment.
PR Review Summary
(0) New Issues | Risk: Low (delta-only review)
This is a delta review — scoped to the 4 files changed since the prior automated review.
✅ Resolved in This Delta
The Critical and Major issues from the prior review have been addressed:
| Prior Issue | Resolution |
|---|---|
🔴 Critical: Error object created but never thrown (ArtifactService.ts:654) |
✅ Dead code removed — the orphaned new Error(...) statement that was ineffective has been deleted |
🟠 Major: Vague changeset message (petite-ends-trade.md) |
✅ Changeset now properly describes the feature: artifact/tool result passing, sentinel reference resolution, and primitive chaining |
📝 Delta Changes Reviewed
| File | Change | Assessment |
|---|---|---|
petite-ends-trade.md |
Expanded changeset description | ✅ Good — clear user-facing description |
ArtifactService.ts |
Removed 8 lines of dead error code | ✅ Good — addresses Critical bug |
PromptConfig.artifactSchema.test.ts |
Updated test assertions (PREVIEW→DISPLAYED to user, FULL→PASSED to tools) |
✅ Good — tests match new schema labels |
functionToolApprovals.test.ts |
Relaxed assertion to expect.objectContaining({ ok: true }) |
✅ Good — accommodates additional return properties |
🕐 Pending Recommendations (4)
These issues were raised in the prior review and remain unaddressed:
- 🟠
function-tools.mdxDocumentation missing sentinel reference syntax for tool chaining - 🟠
ArtifactService.test.tsMissing test coverage for cache key fix (data→full) - 🟠
ArtifactService.test.tsMissing tests forgetArtifactFullfallback chain andgetToolResultRaw - 🟠
agents-cliMissing changeset for CLI pull-v4 refactoring
💡 APPROVE WITH SUGGESTIONS
Summary: The delta changes directly address the Critical issue (dead error code) and improve the changeset messaging. The remaining Major items from the prior review (documentation and test coverage gaps) are still outstanding but do not block the core functionality. Nice work fixing the validation bug! 🎉
Reviewers (0)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
| Delta review — no subagents dispatched | — | — | — | — | — | — | — |
Note: Delta was too small (4 files, 28 lines) to warrant subagent dispatch. Review performed directly by orchestrator.
There was a problem hiding this comment.
PR Review Summary
(1) Total Issues | Risk: High
This is a delta review scoped to 3 files changed since the last automated review (commit 598ab96652af).
🔴❗ Critical (1) ❗🔴
Inline Comments:
- 🔴 Critical:
PromptConfig.ts:753Template literal corrupted by formatter — LLM system prompt will be gibberish
📝 Delta Changes Assessed
| File | Change | Assessment |
|---|---|---|
PromptConfig.ts |
getToolChainingGuidance() method corrupted |
🔴 CRITICAL — See inline comment |
conversations.artifact-replacement.test.ts |
New test file (140 lines) | ✅ Good — well-structured tests for artifact replacement in conversation history |
ArtifactParser.ts |
Import reordering | ✅ Trivial — formatter change, no functional impact |
Root Cause Analysis
The corruption in PromptConfig.ts appears to be the result of an aggressive auto-formatter (Biome) that parsed the template literal content as JavaScript code and "fixed" it. The original prose:
TOOL RESULT CHAINING:
Any tool argument can reference the raw output...
Was transformed into:
TOOL;
RESULT;
CHAINING: Any;
tool;
argument;
can;
reference;This happens when formatters don't recognize prose content inside template literals and attempt to apply JS/TS rules to it.
🗣️ Open Discussion
The validation plan discussion for tool result chaining remains active. This is a follow-up feature consideration, not a blocking issue for this PR.
🚫 REQUEST CHANGES
Summary: The delta introduces a critical regression — the getToolChainingGuidance() method in PromptConfig.ts has been corrupted by a formatter, rendering the tool chaining system prompt unintelligible. This must be fixed before merge. The new test file looks good, and the import reordering is trivial.
To fix: Revert PromptConfig.ts to the state at 598ab96652af or manually restore the template literal. Consider adding a biome ignore comment to protect prose-heavy template literals from formatter interference.
Discarded (0)
No findings were discarded.
Reviewers (0)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
| Delta review — no subagents dispatched | — | — | — | — | — | — | — |
Note: Delta was small (3 files, ~160 net lines in the critical file) and the issue was immediately apparent. Review performed directly by orchestrator.
There was a problem hiding this comment.
PR Review Summary
(0) New Issues in Delta | Risk: High (prior Critical unresolved)
This is a delta review scoped to the 1 file changed since the last automated review (commit c1b6ccecb398).
📝 Delta Changes Assessed
| File | Change | Assessment |
|---|---|---|
ArtifactService.test.ts |
12 lines: result!. → result?. |
✅ Good — safer optional chaining in test assertions |
The delta consists entirely of test style improvements — changing non-null assertions (!) to optional chaining (?.) in test expectations. This is a minor code quality improvement that aligns with TypeScript best practices for handling potentially null values.
🕐 Pending Recommendations (1)
🔴 PromptConfig.ts:753 CRITICAL: Template literal corrupted by formatter — The getToolChainingGuidance() method remains corrupted from the prior review. The LLM system prompt will contain gibberish instead of tool chaining instructions. This is blocking.
🗣️ Open Discussion
The validation plan discussion for tool result chaining remains active — this is a follow-up feature consideration, not blocking for this PR.
🚫 REQUEST CHANGES
Summary: The delta changes (test assertion style) are fine. However, the CRITICAL issue from the prior review remains unresolved — the getToolChainingGuidance() method in PromptConfig.ts is still corrupted by formatter, which will break the tool chaining feature entirely. This must be fixed before merge.
To fix: Revert PromptConfig.ts:752-944 to the working state at 598ab96652af or manually restore the template literal prose.
Discarded (0)
No findings were discarded.
Reviewers (0)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
| Delta review — no subagents dispatched | — | — | — | — | — | — | — |
Note: Delta was trivial (1 file, 12 lines of test assertion style changes). Review performed directly by orchestrator.
amikofalvy
left a comment
There was a problem hiding this comment.
@pullfrog, address PromptConfig.ts formatting issue
|
Restored the corrupted |
…fore compression (#2427) * identified compressor bugs and fixed them * updated changeset * updated agents api * updated * fix: use summary-only fallback for rehydrated artifact data * revert: restore full data fallback for rehydrated artifact summaryData * fix: add span attribute on artifact lookup failure * style: auto-format with biome * fix(agents-api): improve artifact lookup failure observability Add toolCallCount to BaseCompressor warn log for artifact batch lookup failures. Add span attribute artifact_lookup.failed in conversations.ts for tracing. * removed bad code --------- Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
PR Review Summary
(0) Total Issues | Risk: Low
Delta Review Scope
This is a delta review of 9 commits since the previous automated review (7e149317b627). The prior Critical issue (corrupted template literal in PromptConfig.ts) was addressed by pullfrog in an earlier commit.
Delta Changes Analyzed
1. Compression Infrastructure Refactoring (BaseCompressor.ts, ConversationCompressor.ts)
- Type rename
ArtifactInfo→CompressedArtifactInfowith newsummaryDatafield - New
findExistingArtifacts()returns richer metadata (isOversized,toolArgs,toolName,summaryData) toolCallInputMapfor tracking tool call inputs across message processing- Constructor options pattern for
ConversationCompressorwithpriorSummarysupport - Comment removal improves signal-to-noise ratio without losing semantic clarity
2. Message Formatting Abstraction (distill-conversation-tool.ts, distill-conversation-history-tool.ts)
- Extracted inline
formatMessageslogic into amessageFormatter: (maxChars?: number) => stringcallback - Enables cleaner separation between message formatting and LLM distillation
- Added
_fallback: booleanfield to summary schemas to indicate when fallback summaries are used
3. Pre-Compression Artifact Replacement (conversations.ts)
- New
getConversationHistoryWithCompression()replaces oversized tool results with compact artifact refs before compression - Batched
getLedgerArtifacts()lookup (solves N+1 query pattern) - Graceful degradation on artifact lookup failure with warning log
4. Test Coverage
- New
conversations.artifact-replacement.test.tscovers artifact replacement scenarios - Tests verify: batched lookups, compact ref format, unchanged behavior when no artifact exists
Agent.test.tsupdated to includebaseModelin test fixtures
Assessment
The delta changes are well-structured refactoring that improves:
✅ Type safety — Richer artifact metadata enables better downstream handling
✅ Separation of concerns — messageFormatter callback cleanly decouples formatting from distillation
✅ Error visibility — _fallback flag makes it explicit when fallback summaries are used
✅ Performance — Batched artifact lookups prevent N+1 queries
✅ Resilience — Graceful degradation on artifact lookup failures
No new issues introduced in this delta. The prior Critical issue is confirmed resolved.
✅ APPROVE
Summary: Clean refactoring delta that improves type safety, separation of concerns, and error visibility. The prior Critical issue (corrupted template literal) was resolved in an earlier commit. The new artifact replacement feature has appropriate test coverage and follows existing patterns.
Discarded (0)
No findings discarded — all delta changes are clean.
Reviewers (1)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
orchestrator-direct |
0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Total | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Note: Sub-agent dispatch failed due to permission errors; review performed directly by orchestrator. Delta scope was clean refactoring with no issues identified.
|
@pullfrog, please re-review the WHOLE PR and tell me if all concerns have been alleviated. |
There was a problem hiding this comment.
Full PR Re-Review Summary
(0) Critical/Major Issues | (2) Minor | (3) Consider | Risk: Low
This is a full re-review of the entire PR (17 files, ~1338 lines) as requested. All prior concerns have been verified.
✅ All Prior Issues Resolved
| Prior Issue | Status | Details |
|---|---|---|
🔴 Error object created but never thrown (ArtifactService.ts:654) |
✅ Resolved | Dead new Error(...) removed; code now logs and returns early |
🔴 getToolChainingGuidance() template literal corrupted by formatter |
✅ Resolved | Contains well-structured prose with clear LLM instructions, examples, and disambiguation |
| 🟠 Vague changeset message | ✅ Resolved | petite-ends-trade.md clearly describes artifact/tool result passing and primitive chaining |
| 🟠 Docs missing sentinel reference syntax | ✅ Resolved | "Tool Output Pipelines" section added to function-tools.mdx (both SDK and visual builder) |
| 🟠 Missing cache key regression test (data → full) | ✅ Resolved | 2 tests verify parts[0].data.full structure and round-trip correctness |
🟠 Missing tests for getArtifactFull fallback chain |
✅ Resolved | 5 tests cover cache hit, DB fallback, taskId fallback, artifactMap, and null |
| 🟡 CLI changeset | N/A | CLI changes were from base branch merge, not this PR |
Implementation Assessment
The core feature is solid:
resolveArgs— Properly handles both{$artifact, $tool}(artifact passing) and{$tool}(ephemeral chaining) sentinels. ThrowsToolChainResolutionErroron failure instead of silently returning unresolved refs. Recursively resolves nested sentinel refs in larger arg objects.getToolResultRaw— Correctly unwraps MCP text/image content arrays, AI SDK text format, and passes through raw results. Blocks failed tool results from propagating.enhanceToolResultWithStructureHints— Wraps primitives with_toolCallIdfor LLM visibility, injects_toolCallIdinto object results even without artifact components.- Constants extraction —
ARTIFACT_TAG,SENTINEL_KEY,ARTIFACT_TOOLconstants inartifact-syntax.tseliminate ~40 hardcoded string occurrences. - Test coverage — 32+ tests covering all new code paths across ArtifactParser, ArtifactService, and conversation compression.
- Documentation — "Tool Output Pipelines" sections added across TypeScript SDK and Visual Builder docs with clear examples and cross-references.
🟡 Minor (2)
See inline comments.
💭 Consider (3)
getToolResultRawonly inspectscontent[0]— Multi-item MCP content arrays will drop items after the first. Acceptable for most tools but worth noting.fullShapeserialized 3x in schema description — Token cost optimization opportunity by printing once and back-referencing.- XML template files still use hardcoded sentinel strings — Can't use TS constants in raw XML; consider a comment in
artifact-syntax.tsnoting template file dependencies.
✅ APPROVE
Summary: All Critical and Major issues from prior reviews are resolved. The implementation is well-structured with proper error handling (throw on unresolvable refs), comprehensive test coverage across all new code paths, and clear documentation. The remaining suggestions are non-blocking improvements. Great feature — tool chaining is clean and well-tested.
| // Wrap primitive results (string, number, boolean, null) with _toolCallId so the LLM can | ||
| // reference them for tool chaining. The AI SDK serializes plain objects as JSON for the | ||
| // Anthropic API, so the LLM sees the full object including _toolCallId — unlike bare | ||
| // primitives which have no place to embed it. The raw value is stored separately in | ||
| // ToolSessionManager, so downstream tools still receive the bare primitive via {$tool}. | ||
| // Covers all primitives including falsy ones (false, 0, "", null). | ||
| if (typeof result !== 'object' || result === null) { | ||
| if (toolCallId) { | ||
| return { [typeof result === 'string' ? 'text' : 'value']: result, _toolCallId: toolCallId }; |
There was a problem hiding this comment.
🟡 Minor: No tests for primitive result wrapping. The branching logic (typeof result === 'string' ? 'text' : 'value') determines what the LLM sees for tool chaining but has no unit tests. Since enhanceToolResultWithStructureHints is private, consider extracting the wrapping logic to a testable utility or adding integration tests that verify the shape of tool results. Easy to regress — a follow-up item, not blocking.
| if (artifactParser && toolDefinition.parameters?.safeParse) { | ||
| const resolvedChanged = | ||
| JSON.stringify(parsedArgsForResolution) !== JSON.stringify(resolvedArgs); | ||
| if (resolvedChanged) { | ||
| const validation = toolDefinition.parameters.safeParse(resolvedArgs); | ||
| if (!validation.success) { | ||
| throw new Error( | ||
| `Resolved tool args failed schema validation for '${toolName}': ${validation.error.message}` | ||
| ); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
🟡 Minor: No tests for post-resolution schema validation. This validation prevents runtime type mismatches when resolved $artifact/$tool data doesn't match the tool's Zod schema. Good defensive addition — consider adding tests for the happy path, validation failure (verify error message), and the skip-when-unchanged optimization as a follow-up.
|
🔎💬 Inkeep AI search and chat service is syncing content for source 'Inkeep Agent Framework Docs' |
Ito Test Report ❌19 test cases ran. 16 passed, 3 failed. This test run verified the Tool Result Passing as Arguments (Tool Chaining) feature from PR #2304. The core ephemeral ✅ Passed (16)❌ Failed (3)Agent chat with artifact passing via $artifact + $tool sentinel – Failed
Conversation history shows compact artifact references – Failed
Schema validation failure after argument resolution – Failed
📋 View Recording |
* allowed artifacts as tool arguments * upadted prompt * Added Artifact Components as Tool Arguments * fixed linter * added test * updated * updated * style: auto-format with biome * testing some tool result chaining * testing some tool result chaining * updated artifacts and prompting * updated agents-docs * updated changeset * fixed tests * docs: clarify reconstructMessageText JSDoc * address review: remove any types and excess comment * refactor: rename typeSchemaMap to artifactSchemasByType * refactor: improve collectProjectArtifactComponents clarity * style: auto-format with biome * fix: correct type cast in collectProjectArtifactComponents * refactor: extract artifact syntax constants and improve sentinel check clarity * test: add regression tests for cache key fix and getArtifactFull fallback chain * updated tests * fix: restore getToolChainingGuidance template literal corrupted by formatter * fix(agents-api): Replace oversized tool results with artifact refs before compression (#2427) * identified compressor bugs and fixed them * updated changeset * updated agents api * updated * fix: use summary-only fallback for rehydrated artifact data * revert: restore full data fallback for rehydrated artifact summaryData * fix: add span attribute on artifact lookup failure * style: auto-format with biome * fix(agents-api): improve artifact lookup failure observability Add toolCallCount to BaseCompressor warn log for artifact batch lookup failures. Add span attribute artifact_lookup.failed in conversations.ts for tracing. * removed bad code --------- Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * keep changeset * Add delete button to external agents edit page (#2441) * updated agents api --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com> Co-authored-by: sarah <[email protected]>