Introduction¶
When using pi-ai to connect to OpenAI-compatible Chat Completions in DeepSeek Harness (DSH), if the session history contains overly long tool-call IDs, the upstream service may reject the request, preventing the conversation from continuing. pi-ai only shortens IDs automatically under specific conditions (e.g., when the provider name is exactly openai and the history originates from different models). For custom providers or when continuing a conversation with the same model, IDs longer than 64 characters are often sent as-is. The following introduces the community plugin dsh-short-tool-ids (maintained by mrbeandev), which optionally shortens these IDs in outbound requests based on the provider, without modifying saved session files.
What is this¶
dsh-short-tool-ids is an experimental plugin for DSH, with the npm package name dsh-short-tool-ids. The version referenced in the current documentation is 0.4.0 (MIT). It only processes pi-ai providers using the openai-completions protocol; other protocols and built-in DeepSeek adapters will not be rewritten even if they appear in the settings. Saved sessions are not edited; the toggle takes effect starting from the next request.
Why this error occurs¶
Some OpenAI-compatible interfaces require tool-call / call_id strings to be a maximum of 64 characters. If longer IDs already exist in the history (the README gives an example of 81 characters), the entire history is resent in every turn, and the error appears before the model responds, for example:
Invalid 'input[5].call_id': string too long. Expected a string with maximum length 64, but got a string with length 81 instead.
The plugin author explains: This is a targeted workaround for the scenario described above, not a universal fix for Responses, Anthropic message IDs, etc.
Core Features¶
- Per-provider Toggle: Enable individually for each model provider in Settings → Short tool-call IDs; default is off for all. Toggles for non-pi-ai providers are disabled; other protocols (such as
anthropic-messages) are marked as unaffected. - Shortening Rule: Normal IDs that exceed 64 characters and require processing are transformed into
call_followed by 48 hexadecimal characters of SHA-256 (53 characters total); the same shortened ID is used for the same call and its tool result. - History Format: Compatible with both DSH 0.1.5 (
tool-resultblocks) and 0.1.7+ (separatetoolmessages) history formats; valid IDs, arguments, outputs, replay metadata, and tool execution identities remain unchanged. - Security Boundary: If a shortened ID conflicts with another ID, the plugin rejects the request rather than mismatching results; compound Responses
call_id|item_idare not modified; signed / native history that cannot be safely rewritten is rejected rather than forcibly stripped. - No Half-Loading: If the version does not match DSH / pi-ai, startup will clearly report an error and refuse to load; it will not “load halfway” or silently modify sessions.
Supported DSH and Runtime Environment¶
Please first execute:
dsh --version
The support range in the documentation is DSH from 0.1.5-rc.1 up to (but not including) 0.3.0, and requires dsh-short-tool-ids 0.4.0 or newer. Versions 0.3.0 and newer will refuse to load unless tested (can be overridden with allowUntestedHarness: true, as explained in the README). Versions lower than 0.1.5-rc.1 are not supported.
Node.js: ^22.19.0 or >=24.0.0 (consistent with pi-ai requirements).
The older plugin 0.3.0 and earlier only adapts to limited combinations such as DSH 0.1.5-rc.2 and will refuse to load on DSH 0.1.7 / 0.2; see the README “Upgrading from 0.3.x or older” for the upgrade path.
Installation and Enablement¶
Install from npm under the web profile (command from the repository README):
dsh plugin --profile web add dsh-short-tool-ids
Stop the running DSH Web process when the current work session concludes, then start it as usual, for example:
dsh web --no-open --port 3080
After refreshing the page, open Settings → Short tool-call IDs, turn on the toggle for the provider reporting the ID length error, and then retry the conversation.
Install from a local directory (path must be absolute):
dsh plugin --profile web add "/absolute/path/to/dsh-short-tool-ids"
Uninstall:
dsh plugin --profile web remove dsh-short-tool-ids
You can also simply turn off the toggle for a specific provider: outbound content will no longer be rewritten starting from the next request. Toggle changes do not require restarting DSH; if saving fails, an error will be displayed rather than a false success.
Typical Usage¶
- Install the plugin and restart DSH Web, then refresh the browser.
- Find the provider with the error in Short tool-call IDs (the list displays display name, route id, and protocol).
- Turn on the toggle for that provider.
- Return to the original session and send a message; the plugin will shorten overlong IDs in outbound pi-ai
openai-completionsrequests. Long IDs in existing history will also be processed on the send path, but will not be written back to the session file on disk.
If the host plugin is not running (e.g., unsupported DSH version), the settings page will explain the situation and the toggle will be unavailable.
Configuration Storage Location (Version Differences)¶
| DSH Version | Toggle Storage Location |
|---|---|
| 0.1.5-rc.x | short-tool-ids section in settings.yaml |
| 0.1.7+ / 0.2.x | Entry in this plugin’s profile patch (cordis.patch.yml) |
When upgrading from 0.3.x or older plugins: Toggles have been migrated from the Settings → Models provider cards to the separate Short tool-call IDs page; coupling with dsh-rpm has been removed.
Applicable Scenarios and Notes¶
Suitable for: Users using OpenAI-compatible Chat Completions via pi-ai who experience request failures due to tool-call IDs exceeding 64 characters; users who need to enable this precisely per provider to avoid accidentally modifying other links.
Things to be aware of:
- The plugin runs with the current DSH process privileges. Please review the source code and the MIT license before installing.
- The README explicitly states: No guarantee of zero regressions; the implementation is a prototype wrapping of the pi-ai adapter, not an official decorator API.
- Only pi-ai providers using openai-completions are actually rewritten; other items may be visible in the UI but should not have an effect.
- The DSH community directory SkillHub Plugin Page is an independent ecosystem site and has no official affiliation with DeepSeek / High-Flyer; the facts in this article are based on the GitHub Repository README.
Links¶
- Directory Page: https://www.skillhub.cn/plugins/mrbeandev/dsh-short-tool-ids
- Source Code & Documentation: https://github.com/mrbeandev/dsh-short-tool-ids
- Issue Reporting: https://github.com/mrbeandev/dsh-short-tool-ids/issues
On supported DSH versions, turning on the toggle per provider allows overlong tool-call IDs to conform to the 64-character limit without touching local session files, restoring conversations interrupted by overly long history IDs.