792b799e16
Built-in tools whose prompt-rendered metadata depends on settings (`TaskTool`, `SearchToolBm25Tool`, `EditTool`) expose `description`/ `label` via getters that re-evaluate on every access. The skip optimization in `#applyActiveToolsByName` is correctness-safe for these because `#computeAppliedToolSignature` reads `tool.description` live each call, so a settings flip mutates the rendered string and differs the signature on the next refresh. This contract was implicit; a future refactor that caches per-tool description strings would silently break it. Defending it explicitly: - Added a regression test that wires a getter onto a CustomTool's `description`, verifies `refreshMCPTools` skips while the underlying state is unchanged, then mutates the state (without changing tool object identity) and verifies the rebuild fires. - Expanded the `#computeAppliedToolSignature` docstring to document the getter-based coverage path and the SDK-init-time closure constants in `sdk.ts` that genuinely cannot change at runtime (`repeatToolDescriptions`, `eagerTasks`, `intentField`, `mcpDiscoveryEnabled`, `secretsEnabled`). Triggered by a review question on whether the skip breaks settings- based prompt changes. It does not, but the property is non-obvious.
@oh-my-pi/pi-coding-agent
Core implementation package for the omp coding agent in the oh-my-pi monorepo.
For installation, setup, provider configuration, model roles, slash commands, and full CLI reference, see:
Package-specific references: