GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(provider): restore plugin evidence fixtures after connectivity fa… · tickernelz/opencode-mem@f5f8cb6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • index.ts
    • services
      • capture-tool-evidence.ts
  • tests/fixtures
    • capture-evidence-plugin.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/index.ts‎

Copy file name to clipboardExpand all lines: src/index.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ export const OpenCodeMemPlugin: Plugin = async (ctx: PluginInput) => {
454454
// on the call itself and falls back to the external API.
455455
// Use the loader so we hit the same module instance as ensureProviderConnected.
456456
if (CONFIG.opencodeProvider) {
457-
const { setConnectedProviders } = await loadOpencodeProvider();
458-
setConnectedProviders([CONFIG.opencodeProvider]);
457+
const provider = await loadOpencodeProvider();
458+
provider.setConnectedProviders?.([CONFIG.opencodeProvider]);
459459
}
460460
}
461461
};
Collapse file

‎src/services/capture-tool-evidence.ts‎

Copy file name to clipboardExpand all lines: src/services/capture-tool-evidence.ts
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ export function extractToolOutcome(state: any): Pick<ToolCallInfo, "status" | "o
4949
}
5050
if (typeof state?.error === "string") parts.push(state.error);
5151
else if (typeof state?.error?.message === "string") parts.push(state.error.message);
52-
const text = sanitizeMemoryContent(parts.join("\n"));
52+
// Bound before sanitizing: multi-megabyte tool logs must not run every
53+
// credential regex over the full payload. The kept excerpt is only
54+
// MAX_CAPTURE_TOOL_RESULT_BYTES; a 2× pre-bound leaves headroom so a split
55+
// UTF-8 / private tag at the cut still fails closed under sanitize.
56+
const bounded = truncateToMaxBytes(parts.join("\n"), MAX_CAPTURE_TOOL_RESULT_BYTES * 2, "");
57+
const text = sanitizeMemoryContent(bounded);
5358
return {
5459
status: knownStatus,
5560
...(text ? { output: truncateToMaxBytes(text, MAX_CAPTURE_TOOL_RESULT_BYTES, OMITTED) } : {}),
Collapse file

‎tests/fixtures/capture-evidence-plugin.mjs‎

Copy file name to clipboardExpand all lines: tests/fixtures/capture-evidence-plugin.mjs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ mock.module(u("services/ai/opencode-provider-loader"), () => ({
6565
setV2Client: () => {},
6666
createV2Client: () => ({}),
6767
setStructuredOutputTimeoutConfig: () => {},
68+
setConnectedProviders: () => {},
69+
setProviderCatalog: () => {},
6870
setConnectedProvidersRefresher: () => {},
6971
clearConnectedProvidersRefresher: () => {},
7072
ensureProviderConnected: async () => true,

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.