praxis-agent 0.62.7 → 0.63.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.
@@ -72,6 +72,8 @@ export interface ClaudeSessionServiceOptions {
72
72
  providerForMainModel?: (model: string) => ModelProvider;
73
73
  /** Creates one fresh main-turn provider per outer user turn; never used for auxiliary model calls. */
74
74
  providerForTurn?: (model?: string) => ModelProvider;
75
+ /** Creates one fresh provider for each automatic session-name suggestion. */
76
+ sessionNameProviderFactory?: () => ModelProvider;
75
77
  /** Creates a provider adapter dedicated to Session memory requests so
76
78
  * adapter-local cache and retry state are not shared with the foreground. */
77
79
  sessionMemoryProviderFactory?: () => ModelProvider;
@@ -1534,7 +1534,7 @@ export class ClaudeSessionService {
1534
1534
  }
1535
1535
  }
1536
1536
  async sessionNameSuggestion(sessionId, signal) {
1537
- const provider = this.provider();
1537
+ const provider = this.options.sessionNameProviderFactory?.() ?? this.provider();
1538
1538
  {
1539
1539
  const transcript = new NativeSessionTranscript({
1540
1540
  sessionId,
@@ -1047,6 +1047,7 @@ const createDefaultService = async ({ eventSink, requireProvider, hooksOnly = fa
1047
1047
  let providerForModel;
1048
1048
  let providerForMainModel;
1049
1049
  let providerForTurn;
1050
+ let sessionNameProviderFactory;
1050
1051
  let providerBillingMode;
1051
1052
  const context = parseContextEnvironment(runtimeEnvironment);
1052
1053
  const apiKey = runtimeEnvironment.PRAXIS_API_KEY;
@@ -1186,6 +1187,9 @@ const createDefaultService = async ({ eventSink, requireProvider, hooksOnly = fa
1186
1187
  ? defaultProvider
1187
1188
  : createProviderStack(selectedModel, 'turn');
1188
1189
  };
1190
+ if (registry.hasExplicitModelAlias('haiku')) {
1191
+ sessionNameProviderFactory = () => createProviderStack('haiku', 'completion');
1192
+ }
1189
1193
  }
1190
1194
  catch (error) {
1191
1195
  const optionalProviderError = error instanceof ProviderAuthenticationError ||
@@ -1238,6 +1242,9 @@ const createDefaultService = async ({ eventSink, requireProvider, hooksOnly = fa
1238
1242
  ...(!experimentalNativeTranscriptWrites && sessionMemoryProviderFactory
1239
1243
  ? { sessionMemoryProviderFactory }
1240
1244
  : {}),
1245
+ ...(!experimentalNativeTranscriptWrites && sessionNameProviderFactory
1246
+ ? { sessionNameProviderFactory }
1247
+ : {}),
1241
1248
  ...(!experimentalNativeTranscriptWrites && sessionKind !== undefined
1242
1249
  ? { sessionKind }
1243
1250
  : {}),
@@ -23,7 +23,11 @@ export function anthropicModelAliasOverridesFromEnvironment(environment) {
23
23
  }
24
24
  export function resolveAnthropicModelAlias(model, overrides = {}) {
25
25
  const longContext = model.endsWith('[1m]');
26
- const family = longContext ? model.slice(0, -'[1m]'.length) : model;
26
+ const family = model === 'best'
27
+ ? 'opus'
28
+ : longContext
29
+ ? model.slice(0, -'[1m]'.length)
30
+ : model;
27
31
  if (family !== 'sonnet' && family !== 'opus' && family !== 'haiku') {
28
32
  return model;
29
33
  }
@@ -47,6 +47,7 @@ export type ProviderRegistrySourceMetadata = ProviderCredentialSourceMetadata;
47
47
  export interface ProviderRegistry {
48
48
  readonly target: ProviderTarget;
49
49
  readonly credentialSource: ProviderRegistrySourceMetadata;
50
+ hasExplicitModelAlias(modelId: string): boolean;
50
51
  create(modelId?: string): ModelProvider;
51
52
  }
52
53
  export declare function resolveProviderContextWindowTokens(options: {
@@ -228,6 +228,16 @@ class NativeProviderRegistry {
228
228
  }
229
229
  throw new ProviderRegistryError('unsupported_provider', `Unsupported provider protocol: ${target.protocol}`);
230
230
  }
231
+ hasExplicitModelAlias(modelId) {
232
+ if (this.target.providerId !== 'anthropic' ||
233
+ this.target.protocol !== 'anthropic-messages')
234
+ return false;
235
+ const family = modelId === 'best' ? 'opus' : modelId;
236
+ if (family !== 'sonnet' && family !== 'opus' && family !== 'haiku')
237
+ return false;
238
+ const override = this.options.anthropicModelAliasOverrides?.[family];
239
+ return override !== undefined && override.trim().length > 0;
240
+ }
231
241
  resolveTarget(target) {
232
242
  if (target.providerId !== 'anthropic' ||
233
243
  target.protocol !== 'anthropic-messages')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "praxis-agent",
3
- "version": "0.62.7",
3
+ "version": "0.63.1",
4
4
  "description": "Local-first, single-user general agent for the command line.",
5
5
  "license": "MIT",
6
6
  "author": "wuqisen",