History

Drop remaining runtime cast in tool resolution parsing

Rhys Sullivan committed 9 months ago

Commit 28def291 parent ac437b51 file · +4 −1Browse files

Unified · Split

executor/packages/database/src/runtime/tool_call_resolution.ts+4−1
@@ -176,7 +176,10 @@ export async function resolveToolForCall( · 175 unmodified lines
176 return Result.err(new Error(unknownToolErrorMessage(toolPath, suggestions)));176 return Result.err(new Error(unknownToolErrorMessage(toolPath, suggestions)));
177 }177 }
178 178
179 const serializedResult = Result.try(() => JSON.parse(entry.serializedToolJson) as SerializedTool);179 const serializedResult = Result.try(() => {
180 const serialized: SerializedTool = JSON.parse(entry.serializedToolJson);
181 return serialized;
182 });
180 if (serializedResult.isErr()) {183 if (serializedResult.isErr()) {
181 return Result.err(184 return Result.err(
182 new Error(`Failed to parse tool registry entry '${resolvedToolPath}': ${serializedResult.error.message}`),185 new Error(`Failed to parse tool registry entry '${resolvedToolPath}': ${serializedResult.error.message}`),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t