@x-all-in-one/coding-helper 0.3.2 → 0.3.3
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.
|
@@ -16,6 +16,8 @@ const OH_MY_OPENCODE_AGENTS = [
|
|
|
16
16
|
'document-writer',
|
|
17
17
|
'multimodal-looker',
|
|
18
18
|
];
|
|
19
|
+
// Unified output token limit for all models
|
|
20
|
+
const OUTPUT_TOKEN_LIMIT = 32000;
|
|
19
21
|
// Default configuration
|
|
20
22
|
export const OPENCODE_DEFAULT_CONFIG = {
|
|
21
23
|
BASE_URL: 'https://code-api.x-aio.com/v1',
|
|
@@ -24,10 +26,10 @@ export const OPENCODE_DEFAULT_CONFIG = {
|
|
|
24
26
|
DEFAULT_SMALL_MODEL: 'Qwen3-Coder-30B-A3B-Instruct',
|
|
25
27
|
// Default limits (hardcoded for v1, will be fetched from API in future)
|
|
26
28
|
DEFAULT_CONTEXT: 128000,
|
|
27
|
-
DEFAULT_OUTPUT:
|
|
29
|
+
DEFAULT_OUTPUT: OUTPUT_TOKEN_LIMIT,
|
|
28
30
|
// Vision model limits
|
|
29
31
|
VISION_CONTEXT: 64000,
|
|
30
|
-
VISION_OUTPUT:
|
|
32
|
+
VISION_OUTPUT: OUTPUT_TOKEN_LIMIT,
|
|
31
33
|
};
|
|
32
34
|
/**
|
|
33
35
|
* OpenCode 工具实现
|
|
@@ -118,11 +120,11 @@ export class OpenCodeTool extends BaseTool {
|
|
|
118
120
|
if (info.name && info.name !== info.id) {
|
|
119
121
|
entry.name = info.name;
|
|
120
122
|
}
|
|
121
|
-
// Set limits (
|
|
123
|
+
// Set limits (context from API, output always use unified limit)
|
|
122
124
|
if (isVision) {
|
|
123
125
|
entry.limit = {
|
|
124
126
|
context: info.context_length || OPENCODE_DEFAULT_CONFIG.VISION_CONTEXT,
|
|
125
|
-
output:
|
|
127
|
+
output: OUTPUT_TOKEN_LIMIT,
|
|
126
128
|
};
|
|
127
129
|
// Add modalities for vision models
|
|
128
130
|
entry.modalities = {
|
|
@@ -133,7 +135,7 @@ export class OpenCodeTool extends BaseTool {
|
|
|
133
135
|
else {
|
|
134
136
|
entry.limit = {
|
|
135
137
|
context: info.context_length || OPENCODE_DEFAULT_CONFIG.DEFAULT_CONTEXT,
|
|
136
|
-
output:
|
|
138
|
+
output: OUTPUT_TOKEN_LIMIT,
|
|
137
139
|
};
|
|
138
140
|
}
|
|
139
141
|
models[info.id] = entry;
|