@link-assistant/agent 0.20.2 → 0.22.0

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.20.2",
3
+ "version": "0.22.0",
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",
package/src/cli/argv.ts CHANGED
@@ -105,7 +105,7 @@ export function getCompactionSafetyMarginFromProcessArgv(): string | null {
105
105
  /**
106
106
  * Extract --compaction-models argument directly from process.argv
107
107
  * The value is a links notation references sequence, e.g.:
108
- * "(big-pickle nemotron-3-super-free minimax-m2.5-free gpt-5-nano qwen3.6-plus-free same)"
108
+ * "(big-pickle minimax-m2.5-free nemotron-3-super-free gpt-5-nano same)"
109
109
  * @returns The compaction models argument from CLI or null if not found
110
110
  * @see https://github.com/link-assistant/agent/issues/232
111
111
  */
@@ -194,7 +194,8 @@ export async function runContinuousServerMode(
194
194
  systemMessage,
195
195
  appendSystemMessage,
196
196
  jsonStandard,
197
- compactionModel
197
+ compactionModel,
198
+ temperature
198
199
  ) {
199
200
  // Check both CLI flag and environment variable for compact JSON mode
200
201
  const compactJson = argv['compact-json'] === true || config.compactJson;
@@ -290,6 +291,7 @@ export async function runContinuousServerMode(
290
291
  compactionModel,
291
292
  system: systemMessage,
292
293
  appendSystem: appendSystemMessage,
294
+ temperature,
293
295
  }),
294
296
  }
295
297
  ).catch((error) => {
@@ -446,7 +448,8 @@ export async function runContinuousDirectMode(
446
448
  systemMessage,
447
449
  appendSystemMessage,
448
450
  jsonStandard,
449
- compactionModel
451
+ compactionModel,
452
+ temperature
450
453
  ) {
451
454
  // Check both CLI flag and environment variable for compact JSON mode
452
455
  const compactJson = argv['compact-json'] === true || config.compactJson;
@@ -523,6 +526,7 @@ export async function runContinuousDirectMode(
523
526
  compactionModel,
524
527
  system: systemMessage,
525
528
  appendSystem: appendSystemMessage,
529
+ temperature,
526
530
  }).catch((error) => {
527
531
  hasError = true;
528
532
  eventHandler.output({
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  /** Default model used when no `--model` CLI argument is provided. */
9
- export const DEFAULT_MODEL = 'opencode/qwen3.6-plus-free';
9
+ export const DEFAULT_MODEL = 'opencode/nemotron-3-super-free';
10
10
 
11
11
  /** Default provider ID extracted from DEFAULT_MODEL. */
12
12
  export const DEFAULT_PROVIDER_ID = DEFAULT_MODEL.split('/')[0];
@@ -31,20 +31,21 @@ export const DEFAULT_COMPACTION_MODEL = 'opencode/gpt-5-nano';
31
31
  * The special value "same" means use the same model as `--model`.
32
32
  *
33
33
  * Parsed as links notation references sequence (single anonymous link):
34
- * "(big-pickle nemotron-3-super-free minimax-m2.5-free gpt-5-nano qwen3.6-plus-free same)"
34
+ * "(big-pickle minimax-m2.5-free nemotron-3-super-free gpt-5-nano same)"
35
35
  *
36
36
  * Context limits (approximate):
37
37
  * big-pickle: ~200K
38
- * nemotron-3-super-free: ~262K
39
38
  * minimax-m2.5-free: ~200K
39
+ * nemotron-3-super-free: ~262K (default model)
40
40
  * gpt-5-nano: ~400K
41
- * qwen3.6-plus-free: ~1M
42
41
  * same: (base model's context)
43
42
  *
43
+ * Note: qwen3.6-plus-free was removed — free promotion ended April 2026.
44
+ * @see https://github.com/link-assistant/agent/issues/242
44
45
  * @see https://github.com/link-assistant/agent/issues/232
45
46
  */
46
47
  export const DEFAULT_COMPACTION_MODELS =
47
- '(big-pickle nemotron-3-super-free minimax-m2.5-free gpt-5-nano qwen3.6-plus-free same)';
48
+ '(big-pickle minimax-m2.5-free nemotron-3-super-free gpt-5-nano same)';
48
49
 
49
50
  /**
50
51
  * Default compaction safety margin as a percentage of usable context window.
@@ -168,5 +168,10 @@ export function buildRunOptions(yargs) {
168
168
  description:
169
169
  'Safety margin (%) of usable context window before triggering compaction. Only applies when the compaction model has equal or smaller context than the base model. Default: 15.',
170
170
  default: DEFAULT_COMPACTION_SAFETY_MARGIN_PERCENT,
171
+ })
172
+ .option('temperature', {
173
+ type: 'number',
174
+ description:
175
+ 'Override the temperature for model completions. When not set, the default per-model temperature is used.',
171
176
  });
172
177
  }
package/src/index.js CHANGED
@@ -313,7 +313,8 @@ async function runAgentMode(argv, request) {
313
313
  systemMessage,
314
314
  appendSystemMessage,
315
315
  jsonStandard,
316
- compactionModel
316
+ compactionModel,
317
+ argv.temperature
317
318
  );
318
319
  } else {
319
320
  // DIRECT MODE: Run everything in single process
@@ -325,7 +326,8 @@ async function runAgentMode(argv, request) {
325
326
  systemMessage,
326
327
  appendSystemMessage,
327
328
  jsonStandard,
328
- compactionModel
329
+ compactionModel,
330
+ argv.temperature
329
331
  );
330
332
  }
331
333
  },
@@ -399,7 +401,8 @@ async function runContinuousAgentMode(argv) {
399
401
  systemMessage,
400
402
  appendSystemMessage,
401
403
  jsonStandard,
402
- compactionModel
404
+ compactionModel,
405
+ argv.temperature
403
406
  );
404
407
  } else {
405
408
  // DIRECT MODE: Run everything in single process
@@ -410,7 +413,8 @@ async function runContinuousAgentMode(argv) {
410
413
  systemMessage,
411
414
  appendSystemMessage,
412
415
  jsonStandard,
413
- compactionModel
416
+ compactionModel,
417
+ argv.temperature
414
418
  );
415
419
  }
416
420
  },
@@ -433,7 +437,8 @@ async function runServerMode(
433
437
  systemMessage,
434
438
  appendSystemMessage,
435
439
  jsonStandard,
436
- compactionModel
440
+ compactionModel,
441
+ temperature
437
442
  ) {
438
443
  const compactJson = argv['compact-json'] === true;
439
444
 
@@ -502,6 +507,7 @@ async function runServerMode(
502
507
  compactionModel,
503
508
  system: systemMessage,
504
509
  appendSystem: appendSystemMessage,
510
+ temperature,
505
511
  }),
506
512
  }
507
513
  ).catch((error) => {
@@ -534,7 +540,8 @@ async function runDirectMode(
534
540
  systemMessage,
535
541
  appendSystemMessage,
536
542
  jsonStandard,
537
- compactionModel
543
+ compactionModel,
544
+ temperature
538
545
  ) {
539
546
  const compactJson = argv['compact-json'] === true;
540
547
 
@@ -587,6 +594,7 @@ async function runDirectMode(
587
594
  compactionModel,
588
595
  system: systemMessage,
589
596
  appendSystem: appendSystemMessage,
597
+ temperature,
590
598
  }).catch((error) => {
591
599
  hasError = true;
592
600
  eventHandler.output({
@@ -1749,10 +1749,9 @@ export namespace Provider {
1749
1749
  }
1750
1750
  if (providerID === 'opencode' || providerID === 'local') {
1751
1751
  priority = [
1752
- 'qwen3.6-plus-free',
1752
+ 'nemotron-3-super-free',
1753
1753
  'minimax-m2.5-free',
1754
1754
  'gpt-5-nano',
1755
- 'nemotron-3-super-free',
1756
1755
  'big-pickle',
1757
1756
  ];
1758
1757
  }
@@ -1781,9 +1780,8 @@ export namespace Provider {
1781
1780
  }
1782
1781
 
1783
1782
  const priority = [
1784
- 'qwen3.6-plus-free',
1785
- 'glm-5-free',
1786
1783
  'nemotron-3-super-free',
1784
+ 'glm-5-free',
1787
1785
  'minimax-m2.5-free',
1788
1786
  'gpt-5-nano',
1789
1787
  'big-pickle',
@@ -1866,7 +1864,7 @@ export namespace Provider {
1866
1864
  * 1. If model is uniquely available in one provider, use that provider
1867
1865
  * 2. If model is available in multiple providers, prioritize based on free model availability:
1868
1866
  * - kilo: glm-5-free, glm-4.5-air-free, minimax-m2.5-free, giga-potato-free, deepseek-r1-free (unique to Kilo)
1869
- * - opencode: big-pickle, gpt-5-nano, qwen3.6-plus-free, nemotron-3-super-free (unique to OpenCode)
1867
+ * - opencode: big-pickle, gpt-5-nano, nemotron-3-super-free (unique to OpenCode)
1870
1868
  * 3. For shared models, prefer OpenCode first, then fall back to Kilo on rate limit
1871
1869
  *
1872
1870
  * @param modelID - Short model name without provider prefix
@@ -411,6 +411,7 @@ export namespace MessageV2 {
411
411
  .optional(),
412
412
  system: z.string().optional(),
413
413
  appendSystem: z.string().optional(),
414
+ temperature: z.number().optional(),
414
415
  tools: z.record(z.string(), z.boolean()).optional(),
415
416
  }).meta({
416
417
  ref: 'UserMessage',
@@ -110,6 +110,7 @@ export namespace SessionPrompt {
110
110
  noReply: z.boolean().optional(),
111
111
  system: z.string().optional(),
112
112
  appendSystem: z.string().optional(),
113
+ temperature: z.number().optional(),
113
114
  tools: z.record(z.string(), z.boolean()).optional(),
114
115
  parts: z.array(
115
116
  z.discriminatedUnion('type', [
@@ -734,10 +735,12 @@ export namespace SessionPrompt {
734
735
  });
735
736
  const params = {
736
737
  temperature:
737
- (model.info?.temperature ?? false)
738
- ? (agent.temperature ??
739
- ProviderTransform.temperature(model.providerID, model.modelID))
740
- : undefined,
738
+ lastUser.temperature != null
739
+ ? lastUser.temperature
740
+ : (model.info?.temperature ?? false)
741
+ ? (agent.temperature ??
742
+ ProviderTransform.temperature(model.providerID, model.modelID))
743
+ : undefined,
741
744
  topP:
742
745
  agent.topP ?? ProviderTransform.topP(model.providerID, model.modelID),
743
746
  options: {
@@ -1189,6 +1192,7 @@ export namespace SessionPrompt {
1189
1192
  tools: input.tools,
1190
1193
  system: input.system,
1191
1194
  appendSystem: input.appendSystem,
1195
+ temperature: input.temperature,
1192
1196
  agent: agent.name,
1193
1197
  model: await resolveModel({
1194
1198
  model: input.model,