Repository navigation
Make tool search and PTC enabled by default - #53
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes This review covers default tool search and programmatic tool calling, including configuration, handoff behavior, documentation, and tests.
- Default tool search Adds
search_toolswhen deferred tools are present, with opt-out and custom-tool replacement support. - Default program calling Adds
run_programwhen the run has callable tools, with opt-out, custom-tool replacement, and recalculation after handoffs. - Documentation and tests Updates usage guidance and covers default behavior, replay, handoffs, and configuration.
Important
This run used your free trial credits ($9.40 of $10 left) on GPT Luna, a fast, lightweight model. Connect a provider → to run the model you choose.
gpt-6-luna (free trial credits) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes This incremental review covers the rename from programmatic tool calling to code mode and the related updates since the prior pullfrog review.
- Renamed the option and implementation Replaced the
programsoption withcodeMode, moved the implementation undercode-mode, and updated its imports and documentation. - Updated tests and replay identifiers Adjusted tests to the new terminology and generalized the replay harness service and invocation names. The package suite passes all 257 tests.
Important
This run used your free trial credits ($9.37 of $10 left) on GPT Luna, a fast, lightweight model. Connect a provider → to run the model you choose.
gpt-6-luna (free trial credits) | 𝕏

Turn on tool search and code mode by default
Agent runs now add
search_toolsandrun_programautomatically. Before this change, you had to addsearchToolsTool()andprogramTool()to an agent's tools yourself.search_toolswhen the agent or the run has adeferredtool. The model sees a deferred tool's schema only after a search loads it, so a large catalog stays out of every request.run_programwhen the agent or the run has a tool a program can call. That is any tool except a handoff or a search tool. The model writes one JavaScript program that runs in QuickJS, calls several tools and returns a compact result. Program calls go through the same guardrails, approvals andmaxToolCallslimit as direct calls.Configure the defaults
agent()has two new options. Both default totrue:tools, such asprogramTool({limits})from/program, replaces the default.Duplicate tool name.Implementation
runTools()inagent-run.tsadds the default tools next to skill tools andread_tool_result. On a handoff, the run decides again based on the new agent's tools. For example, if the new agent has no deferred tools, the run dropssearch_tools.SEARCH_TOOLandPROGRAM_TOOLhold the tool names.Rename programmatic tool calling to code mode
src/ptc/is nowsrc/code-mode/, and theptc-*test files are nowcode-mode-*.PTCTestservice is nowReplayTest, because every replay test uses it.programTool, the/programimport path, therun_programtool and theprogram: trueflag keep their names. They name the program the model writes, not the feature, andprogramTooland/programwere released in 0.1.0.Behavior changes for existing users
search_toolsloads them. SettoolSearch: falseto keep the old behavior.run_programgrows by about 320 tokens, andsearch_toolsadds about 100. The context-size estimate (jsonTokens, about 2 characters per token) counts them as about 635 and 205. That's why the compaction and usage tests that measure where the cut lands setcodeMode: false.search_toolsorrun_programnow fails the run while the run adds the default with that name.Documentation
README.mdandpackages/core/README.mddescribe the new defaults.restate-agentsskill (SKILL.md,references/tools.md,references/conversations-and-controls.md) documents the options, how to replace the defaults, and the reserved names.tools.mdand thecodeModedoc comment, so a search for that term still finds it.Testing
catalog-program.test.tscover:pnpm build(compile, lint, format, typecheck),pnpm test(257 unit tests) andpnpm test:integration(68 integration tests) pass.🤖 Generated with Claude Code