opencode-aicodewith-auth 0.1.48 → 0.1.50

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.
Files changed (2) hide show
  1. package/dist/index.js +33 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -694,13 +694,30 @@ function resolveInclude(body) {
694
694
  }
695
695
  return include;
696
696
  }
697
- function stripItemIds(input) {
697
+ function sanitizeItemIds(input) {
698
+ const outputCallIds = new Set;
699
+ for (const item of input) {
700
+ if (item.type === "function_call_output" || item.type === "local_shell_call_output" || item.type === "custom_tool_call_output") {
701
+ const callId = item.call_id;
702
+ if (typeof callId === "string" && callId.trim().length > 0) {
703
+ outputCallIds.add(callId.trim());
704
+ }
705
+ }
706
+ }
698
707
  return input.filter((item) => item.type !== "item_reference").map((item) => {
699
- if ("id" in item) {
700
- const { id, ...rest } = item;
701
- return rest;
708
+ if (!("id" in item)) {
709
+ return item;
702
710
  }
703
- return item;
711
+ const isCallItem = item.type === "function_call" || item.type === "local_shell_call" || item.type === "custom_tool_call";
712
+ if (isCallItem) {
713
+ const callId = item.call_id;
714
+ const hasMatchingOutput = typeof callId === "string" && callId.trim().length > 0 && outputCallIds.has(callId.trim());
715
+ if (hasMatchingOutput) {
716
+ return item;
717
+ }
718
+ }
719
+ const { id, ...rest } = item;
720
+ return rest;
704
721
  });
705
722
  }
706
723
  function filterOpenCodeSystemPrompts(input) {
@@ -750,9 +767,10 @@ async function transformRequestBody(body, codexInstructions) {
750
767
  });
751
768
  body.model = normalizedModel;
752
769
  body.stream = true;
770
+ body.store = false;
753
771
  body.instructions = codexInstructions;
754
772
  if (body.input && Array.isArray(body.input)) {
755
- body.input = stripItemIds(body.input);
773
+ body.input = sanitizeItemIds(body.input);
756
774
  body.input = filterOpenCodeSystemPrompts(body.input);
757
775
  body.input = addCodexBridgeMessage(body.input, !!body.tools);
758
776
  if (body.input) {
@@ -2029,6 +2047,15 @@ var AicodewithCodexAuthPlugin = async (ctx) => {
2029
2047
  if (input.model.providerID !== PROVIDER_ID2)
2030
2048
  return;
2031
2049
  if (isCodexModel(input.model.id)) {
2050
+ const next2 = { ...output.options };
2051
+ next2.providerOptions = {
2052
+ ...next2.providerOptions,
2053
+ openai: {
2054
+ ...next2.providerOptions?.openai,
2055
+ store: false
2056
+ }
2057
+ };
2058
+ output.options = next2;
2032
2059
  return;
2033
2060
  }
2034
2061
  if (!input.model.id?.startsWith("claude-"))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-aicodewith-auth",
3
- "version": "0.1.48",
3
+ "version": "0.1.50",
4
4
  "description": "OpenCode plugin for AICodewith authentication - Access GPT-5.3 Codex, GPT-5.2, Claude, and Gemini models through AICodewith API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",