IsInjectedID reports whether the given ID was generated by this package. Checks both the canonical marker ("cpa_inject_") and the underscore-stripped variant ("cpainject") to handle agents that normalize tool_call_ids.
(id string)
| 37 | // Checks both the canonical marker ("cpa_inject_") and the underscore-stripped |
| 38 | // variant ("cpainject") to handle agents that normalize tool_call_ids. |
| 39 | func IsInjectedID(id string) bool { |
| 40 | return strings.Contains(id, InjectedIDMarker) || strings.Contains(id, InjectedIDMarkerNoUnderscore) |
| 41 | } |
| 42 | |
| 43 | // ExtractTaskID extracts the encoded task ID from an injected call ID. |
| 44 | // Returns (taskID, true) on success or (0, false) if the ID is not injected |
no outgoing calls