Skip to content

Onboard: fix X setupWizard crash; tighten QVeris prompt + error hints#109

Merged
linfangw merged 2 commits into
mainfrom
qveris_enhancement
Mar 23, 2026
Merged

Onboard: fix X setupWizard crash; tighten QVeris prompt + error hints#109
linfangw merged 2 commits into
mainfrom
qveris_enhancement

Conversation

@linfangw

Copy link
Copy Markdown
Member

Summary

Describe the problem and fix in 2–5 bullets:

  • Problem: After QVeris setup in qverisbot onboard, the wizard could crash with TypeError: Cannot read properties of undefined (reading 'resolveConfigured') because the X channel plugin exposed a ChannelSetupWizardAdapter shape as setupWizard (via as unknown), while core onboarding expects a ChannelSetupWizard with status.resolveConfigured. Separately, models sometimes drifted toward direct QVeris HTTP calls, wrong base URLs, or mishandling QVERIS_API_KEY in guidance.
  • Why it matters: Onboarding blocked users who hit the X plugin path during channel status collection; QVeris misuse hurts reliability and security posture (credentials / endpoints).
  • What changed: X: replaced the cast with a real ChannelSetupWizard (xSetupWizard) using createStandardChannelSetupStatus and moved interactive setup into finalize; updated tests. QVeris: stricter system-prompt “access rules,” concise workflow note on classified errors, tests for prompt/error behavior; wizard mock fix for resolveSearchProviderSignupUrl where applicable.
  • What did NOT change (scope boundary): No new runtime HTTP guards for QVeris; no changes to QVeris API contracts or plugin packaging beyond X onboarding shape and prompt/error text.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #
  • Related #

User-visible / Behavior Changes

  • Onboarding should complete past QVeris without crashing when the X channel plugin is in the channel setup path.
  • Agent system prompt includes clearer QVeris tool-only rules and full_content_file_url exception where applicable.
  • QVeris tool error payloads include a short workflow reminder (do not call discovery/execute endpoints directly; do not reveal QVERIS_API_KEY).

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No (prompt/error text only; no new secret storage paths)
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: (your host, e.g. macOS / Linux)
  • Runtime/container: Node 22+ / pnpm
  • Model/provider: N/A for these fixes
  • Integration/channel (if any): X plugin loaded during onboard channel step
  • Relevant config (redacted): tools.qveris.* set during wizard; X plugin present in bundle

Steps

  1. Run qverisbot onboard (or openclaw onboard) through QVeris region + API key prompts.
  2. Continue into channel setup where status is collected for all installed channels (including X).
  3. Confirm wizard proceeds without resolveConfigured TypeError.

Expected

  • No crash; channel status step runs; QVeris prompts behave as before.

Actual

  • (Before) Crash after QVeris step with resolveConfigured on undefined. (After) Proceeds normally.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

(CI / local: pnpm test on touched areas, e.g. extensions/x/src/onboarding.test.ts, src/channels/plugins/setup-wizard*, src/agents/system-prompt.test.ts, src/agents/tools/qveris-tools.test.ts.)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: Interactive onboard past QVeris + channel status; X setup wizard path if you exercise X in the picker.
  • Edge cases checked: Blank QVeris key (env-only), skip channels, X configured vs unconfigured.
  • What you did not verify: Full matrix of all channels + all flows; production gateway long-run.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No
  • If yes, exact upgrade steps: N/A

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: Revert the two commits (or this PR).
  • Files/config to restore: None beyond git revert.
  • Known bad symptoms reviewers should watch for: X channel guided setup prompts duplicated or out of order vs other channels; missing accountId in results from finalize (should match prior behavior for default account).

Risks and Mitigations

  • Risk: X onboarding UX differs slightly from the old adapter-only flow (credentials now run in finalize).
    • Mitigation: Tests updated; manually run X channel setup once in onboard/configure flows.
  • Risk: Prompt/error text length affects token budget.
    • Mitigation: QVeris errors use a single concise QVERIS_WORKFLOW_NOTE; prompt changes are targeted.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily addresses a critical bug that caused the onboarding wizard to crash when the X channel plugin was involved in the channel status collection, ensuring a smoother user experience. Concurrently, it enhances the reliability and security posture of QVeris tool usage by refining the system prompts and error messages. These changes guide the agent models to interact with QVeris tools correctly, preventing misuse of credentials and direct API calls, thereby improving the overall stability and security of the system.

Highlights

  • X Setup Wizard Crash Fix: Resolved a TypeError: Cannot read properties of undefined (reading 'resolveConfigured') crash during QVeris setup in qverisbot onboard. This occurred because the X channel plugin incorrectly exposed a ChannelSetupWizardAdapter shape as setupWizard, while the core onboarding expected a ChannelSetupWizard with status.resolveConfigured.
  • QVeris Prompt and Error Hints Tightened: Implemented stricter system-prompt 'access rules' for QVeris tools and added concise workflow notes to classified errors. This addresses issues where models might drift towards direct QVeris HTTP calls, use wrong base URLs, or mishandle QVERIS_API_KEY.
  • X Channel Plugin Refactor: Replaced the unsafe as unknown cast in the X plugin with a proper ChannelSetupWizard (xSetupWizard) using createStandardChannelSetupStatus. Interactive setup logic was moved into the finalize method, and associated tests were updated.
  • Improved QVeris Error Handling: QVeris tool error payloads now include a short workflow reminder to prevent direct API calls and credential exposure, enhancing reliability and security.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@linfangw
linfangw merged commit 5d8f308 into main Mar 23, 2026
2 of 8 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the X (Twitter) channel onboarding process to use the new ChannelSetupWizard interface, improving its structure and testability. Additionally, it enhances the QVeris tool integration for AI agents by adding explicit access rules to the system prompt and incorporating workflow guidance notes into QVeris error responses. These changes aim to ensure agents adhere to proper tool usage patterns and avoid direct API calls. I have no feedback to provide.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant