@link-assistant/agent 0.16.11 → 0.16.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/agent",
3
- "version": "0.16.11",
3
+ "version": "0.16.12",
4
4
  "description": "A minimal, public domain AI CLI agent compatible with OpenCode's JSON interface. Bun-only runtime.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -1201,15 +1201,23 @@ export namespace Provider {
1201
1201
  sessionID: provider.id,
1202
1202
  });
1203
1203
 
1204
- // Wrap fetch with verbose HTTP logging when --verbose is enabled
1205
- // This logs raw HTTP request/response details for debugging provider issues
1204
+ // Wrap fetch with verbose HTTP logging for debugging provider issues.
1205
+ // IMPORTANT: The verbose check is done at call time (not SDK creation time)
1206
+ // because the SDK is cached and Flag.OPENCODE_VERBOSE may change after creation.
1207
+ // When verbose is disabled, the wrapper is a no-op passthrough with negligible overhead.
1206
1208
  // See: https://github.com/link-assistant/agent/issues/200
1207
- if (Flag.OPENCODE_VERBOSE) {
1209
+ // See: https://github.com/link-assistant/agent/issues/206
1210
+ {
1208
1211
  const innerFetch = options['fetch'];
1209
1212
  options['fetch'] = async (
1210
1213
  input: RequestInfo | URL,
1211
1214
  init?: RequestInit
1212
1215
  ): Promise<Response> => {
1216
+ // Check verbose flag at call time — not at SDK creation time
1217
+ if (!Flag.OPENCODE_VERBOSE) {
1218
+ return innerFetch(input, init);
1219
+ }
1220
+
1213
1221
  const url =
1214
1222
  typeof input === 'string'
1215
1223
  ? input