chore: fix user email, telemetryEnabled by default
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
"models": {
|
"models": {
|
||||||
"main": {
|
"main": {
|
||||||
"provider": "anthropic",
|
"provider": "anthropic",
|
||||||
"modelId": "claude-sonnet-4-20250514",
|
"modelId": "claude-3-7-sonnet-20250219",
|
||||||
"maxTokens": 50000,
|
"maxTokens": 64000,
|
||||||
"temperature": 0.2
|
"temperature": 0.2
|
||||||
},
|
},
|
||||||
"research": {
|
"research": {
|
||||||
@@ -14,8 +14,8 @@
|
|||||||
},
|
},
|
||||||
"fallback": {
|
"fallback": {
|
||||||
"provider": "anthropic",
|
"provider": "anthropic",
|
||||||
"modelId": "claude-3-7-sonnet-20250219",
|
"modelId": "claude-3-5-sonnet",
|
||||||
"maxTokens": 128000,
|
"maxTokens": 64000,
|
||||||
"temperature": 0.2
|
"temperature": 0.2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -26,13 +26,12 @@
|
|||||||
"defaultPriority": "medium",
|
"defaultPriority": "medium",
|
||||||
"projectName": "Taskmaster",
|
"projectName": "Taskmaster",
|
||||||
"ollamaBaseURL": "http://localhost:11434/api",
|
"ollamaBaseURL": "http://localhost:11434/api",
|
||||||
"azureBaseURL": "https://your-endpoint.azure.com/",
|
"azureBaseURL": "https://your-endpoint.azure.com/"
|
||||||
"ollamaBaseUrl": "http://localhost:11434/api"
|
|
||||||
},
|
},
|
||||||
"account": {
|
"account": {
|
||||||
"userId": "1234567890",
|
"userId": "2e8d1938-b65d-4b3d-b480-efb488284fe3",
|
||||||
"email": "",
|
"email": "anon-2e8d1938-b65d-4b3d-b480-efb488284fe3@taskmaster.temp",
|
||||||
"mode": "hosted",
|
"mode": "byok",
|
||||||
"telemetryEnabled": true
|
"telemetryEnabled": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"models": {
|
|
||||||
"main": {
|
|
||||||
"provider": "anthropic",
|
|
||||||
"modelId": "claude-3-7-sonnet-20250219",
|
|
||||||
"maxTokens": 120000,
|
|
||||||
"temperature": 0.2
|
|
||||||
},
|
|
||||||
"research": {
|
|
||||||
"provider": "perplexity",
|
|
||||||
"modelId": "sonar-pro",
|
|
||||||
"maxTokens": 8700,
|
|
||||||
"temperature": 0.1
|
|
||||||
},
|
|
||||||
"fallback": {
|
|
||||||
"provider": "anthropic",
|
|
||||||
"modelId": "claude-3-5-sonnet-20240620",
|
|
||||||
"maxTokens": 8192,
|
|
||||||
"temperature": 0.1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"global": {
|
|
||||||
"logLevel": "info",
|
|
||||||
"debug": false,
|
|
||||||
"defaultSubtasks": 5,
|
|
||||||
"defaultPriority": "medium",
|
|
||||||
"projectName": "Taskmaster",
|
|
||||||
"ollamaBaseURL": "http://localhost:11434/api",
|
|
||||||
"azureOpenaiBaseURL": "https://your-endpoint.openai.azure.com/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -187,7 +187,6 @@ function writeApiKeyToEnv(token, explicitRoot = null) {
|
|||||||
|
|
||||||
// Write updated content
|
// Write updated content
|
||||||
fs.writeFileSync(envPath, envContent);
|
fs.writeFileSync(envPath, envContent);
|
||||||
log("info", "User authentication token written to .env file");
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log("error", `Failed to write user token to .env: ${error.message}`);
|
log("error", `Failed to write user token to .env: ${error.message}`);
|
||||||
}
|
}
|
||||||
@@ -321,10 +320,6 @@ async function initializeBYOKUser(projectRoot) {
|
|||||||
// If we have an existing anonymous user ID, try to reuse it
|
// If we have an existing anonymous user ID, try to reuse it
|
||||||
if (existingAnonymousUserId && existingAnonymousUserId !== "1234567890") {
|
if (existingAnonymousUserId && existingAnonymousUserId !== "1234567890") {
|
||||||
headers["X-Anonymous-User-ID"] = existingAnonymousUserId;
|
headers["X-Anonymous-User-ID"] = existingAnonymousUserId;
|
||||||
log(
|
|
||||||
"info",
|
|
||||||
`Attempting to reuse existing anonymous user: ${existingAnonymousUserId}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call gateway /auth/anonymous to create or reuse a user account
|
// Call gateway /auth/anonymous to create or reuse a user account
|
||||||
@@ -338,16 +333,6 @@ async function initializeBYOKUser(projectRoot) {
|
|||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
|
|
||||||
// Log whether user was reused or newly created
|
|
||||||
if (result.isReused) {
|
|
||||||
log(
|
|
||||||
"info",
|
|
||||||
`Successfully reused existing anonymous user: ${result.anonymousUserId}`
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
log("info", `Created new anonymous user: ${result.anonymousUserId}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Store the user token (same as hosted users)
|
// Store the user token (same as hosted users)
|
||||||
// BYOK users won't use this for AI calls, but will have it for potential mode switch
|
// BYOK users won't use this for AI calls, but will have it for potential mode switch
|
||||||
if (result.session && result.session.access_token) {
|
if (result.session && result.session.access_token) {
|
||||||
@@ -360,10 +345,10 @@ async function initializeBYOKUser(projectRoot) {
|
|||||||
}
|
}
|
||||||
config.account.userId = result.anonymousUserId || result.user.id;
|
config.account.userId = result.anonymousUserId || result.user.id;
|
||||||
config.account.mode = "byok";
|
config.account.mode = "byok";
|
||||||
config.account.userEmail =
|
config.account.email =
|
||||||
result.user.email ||
|
result.user.email ||
|
||||||
`anon-${result.anonymousUserId || result.user.id}@taskmaster.temp`;
|
`anon-${result.anonymousUserId || result.user.id}@taskmaster.temp`;
|
||||||
config.account.telemetryEnabled = false; // BYOK users don't send telemetry by default
|
config.account.telemetryEnabled = true;
|
||||||
|
|
||||||
writeConfig(config, projectRoot);
|
writeConfig(config, projectRoot);
|
||||||
|
|
||||||
|
|||||||
16
tests/fixtures/.taskmasterconfig
vendored
16
tests/fixtures/.taskmasterconfig
vendored
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"models": {
|
|
||||||
"main": {
|
|
||||||
"provider": "openai",
|
|
||||||
"modelId": "gpt-4o"
|
|
||||||
},
|
|
||||||
"research": {
|
|
||||||
"provider": "perplexity",
|
|
||||||
"modelId": "sonar-pro"
|
|
||||||
},
|
|
||||||
"fallback": {
|
|
||||||
"provider": "anthropic",
|
|
||||||
"modelId": "claude-3-haiku-20240307"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user