@link-assistant/agent 0.18.0 → 0.18.1
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 +1 -1
- package/src/index.js +8 -2
- package/src/provider/provider.ts +10 -13
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -802,8 +802,14 @@ async function main() {
|
|
|
802
802
|
compactJson: isCompact,
|
|
803
803
|
});
|
|
804
804
|
|
|
805
|
-
//
|
|
806
|
-
//
|
|
805
|
+
// Global fetch monkey-patch for verbose HTTP logging (#221).
|
|
806
|
+
// This catches any HTTP calls that go through globalThis.fetch directly,
|
|
807
|
+
// including non-provider calls (auth, config, tools) that may not have
|
|
808
|
+
// their own createVerboseFetch wrapper. The provider-level wrapper in
|
|
809
|
+
// provider.ts getSDK() also logs independently — both mechanisms are
|
|
810
|
+
// kept active to maximize HTTP observability in --verbose mode.
|
|
811
|
+
// See: https://github.com/link-assistant/agent/issues/221
|
|
812
|
+
// See: https://github.com/link-assistant/agent/issues/217
|
|
807
813
|
if (!globalThis.__agentVerboseFetchInstalled) {
|
|
808
814
|
globalThis.fetch = createVerboseFetch(globalThis.fetch, {
|
|
809
815
|
caller: 'global',
|
package/src/provider/provider.ts
CHANGED
|
@@ -1201,11 +1201,13 @@ export namespace Provider {
|
|
|
1201
1201
|
sessionID: provider.id,
|
|
1202
1202
|
});
|
|
1203
1203
|
|
|
1204
|
-
// Verbose HTTP logging
|
|
1205
|
-
//
|
|
1206
|
-
//
|
|
1207
|
-
//
|
|
1208
|
-
//
|
|
1204
|
+
// Verbose HTTP logging for provider API calls.
|
|
1205
|
+
// This provider-level wrapper logs HTTP requests/responses independently
|
|
1206
|
+
// of the global fetch monkey-patch. Both mechanisms are kept active to
|
|
1207
|
+
// maximize HTTP observability — the global patch may miss calls if the
|
|
1208
|
+
// AI SDK captures/resolves fetch references before it is installed,
|
|
1209
|
+
// while this wrapper is injected directly into the SDK's fetch option.
|
|
1210
|
+
// See: https://github.com/link-assistant/agent/issues/221
|
|
1209
1211
|
// See: https://github.com/link-assistant/agent/issues/217
|
|
1210
1212
|
// See: https://github.com/link-assistant/agent/issues/215
|
|
1211
1213
|
{
|
|
@@ -1226,14 +1228,9 @@ export namespace Provider {
|
|
|
1226
1228
|
init?: RequestInit
|
|
1227
1229
|
): Promise<Response> => {
|
|
1228
1230
|
// Check verbose flag at call time — not at SDK creation time.
|
|
1229
|
-
//
|
|
1230
|
-
//
|
|
1231
|
-
|
|
1232
|
-
// See: https://github.com/link-assistant/agent/issues/217
|
|
1233
|
-
if (
|
|
1234
|
-
!Flag.OPENCODE_VERBOSE ||
|
|
1235
|
-
globalThis.__agentVerboseFetchInstalled
|
|
1236
|
-
) {
|
|
1231
|
+
// This ensures --verbose works even when the flag is set after SDK creation.
|
|
1232
|
+
// See: https://github.com/link-assistant/agent/issues/206
|
|
1233
|
+
if (!Flag.OPENCODE_VERBOSE) {
|
|
1237
1234
|
return innerFetch(input, init);
|
|
1238
1235
|
}
|
|
1239
1236
|
|