Skip to content

feat: add kilo_user_id to welcome Typeform survey hidden fields#384

Open
kiloconnect[bot] wants to merge 1 commit intodevfrom
session/agent_5572d4d6-8a9e-4751-9835-e6fc4c3bd239
Open

feat: add kilo_user_id to welcome Typeform survey hidden fields#384
kiloconnect[bot] wants to merge 1 commit intodevfrom
session/agent_5572d4d6-8a9e-4751-9835-e6fc4c3bd239

Conversation

@kiloconnect
Copy link
Contributor

@kiloconnect kiloconnect bot commented Feb 17, 2026

Summary

Add kilo_user_id as a hidden field to the Typeform welcome/onboarding survey so survey responses can be linked back to users without relying on PII (email).

Changes

kilo-gateway

  • src/types.ts — Add optional id field to KilocodeProfile interface
  • src/api/profile.ts — Parse id from the backend profile API response (user.id or top-level id)
  • src/api/survey.ts (new)buildWelcomeSurveyUrl() helper that constructs the Typeform URL with email and kilo_user_id hidden fields
  • src/index.ts — Export buildWelcomeSurveyUrl
  • src/server/routes.ts — Add id to the Profile zod schema

kilo-vscode

  • src/services/welcome-survey.ts (new) — Local buildWelcomeSurveyUrl() for the VS Code extension
  • src/KiloProvider.ts — After successful login, open the welcome survey URL with both email and kilo_user_id hidden fields
  • src/services/cli-backend/types.ts — Add id? to KilocodeProfile
  • webview-ui/src/types/messages.ts — Add id? to ProfileData.profile

How it works

After a user completes the login flow, the extension builds a Typeform URL like:

https://kilocode.typeform.com/welcome?email=user@example.com&kilo_user_id=abc123

and opens it in the user's default browser via vscode.env.openExternal().


Built for joao by Kilo for Slack

- Add id field to KilocodeProfile type and profile API parsing
- Create buildWelcomeSurveyUrl helper in kilo-gateway
- Create welcome-survey module in VS Code extension
- Open welcome survey after successful login with email + kilo_user_id
- Update server routes schema to include profile id
kiloUserId: profileData.profile.id,
})
vscode.env.openExternal(vscode.Uri.parse(surveyUrl))
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Survey opens on every login, not just first-time signup

This code runs unconditionally after every successful login. Returning users who re-authenticate (e.g., token expired) will get the welcome survey opened in their browser every time. Consider gating this behind a check — e.g., a globalState flag like kiloSurveyShown, or a backend signal indicating the user is newly created.

// Example approach:
const alreadyShown = this.context.globalState.get<boolean>("kiloSurveyShown")
if (!alreadyShown && profileData?.profile.email) {
  const surveyUrl = buildWelcomeSurveyUrl({ ... })
  vscode.env.openExternal(vscode.Uri.parse(surveyUrl))
  this.context.globalState.update("kiloSurveyShown", true)
}

* @param options.kiloUserId - Kilo internal user ID
* @returns Fully-qualified Typeform URL with hidden fields as query params
*/
export function buildWelcomeSurveyUrl(options: { email: string; kiloUserId?: string }): string {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Duplicate code with packages/kilo-vscode/src/services/welcome-survey.ts

This function is identical to the one in the vscode package. While the vscode extension can't depend on @kilocode/kilo-gateway directly (it's bundled separately), having two copies means bug fixes or URL changes need to be applied in both places. Consider extracting this into a shared utility package (e.g., @opencode-ai/util) that both can depend on, or at minimum add a comment cross-referencing the other copy.

@kiloconnect
Copy link
Contributor Author

kiloconnect bot commented Feb 17, 2026

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/src/KiloProvider.ts 982 Survey opens on every login, not just first-time signup. Returning users will see the welcome survey repeatedly.

SUGGESTION

File Line Issue
packages/kilo-gateway/src/api/survey.ts 18 buildWelcomeSurveyUrl is duplicated identically in packages/kilo-vscode/src/services/welcome-survey.ts. Consider extracting to a shared package.
Files Reviewed (9 files)
  • packages/kilo-gateway/src/api/profile.ts - 0 issues
  • packages/kilo-gateway/src/api/survey.ts - 1 issue
  • packages/kilo-gateway/src/index.ts - 0 issues
  • packages/kilo-gateway/src/server/routes.ts - 0 issues
  • packages/kilo-gateway/src/types.ts - 0 issues
  • packages/kilo-vscode/src/KiloProvider.ts - 1 issue
  • packages/kilo-vscode/src/services/cli-backend/types.ts - 0 issues
  • packages/kilo-vscode/src/services/welcome-survey.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/types/messages.ts - 0 issues

Fix these issues in Kilo Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants