Skip to content

Comments

fix: xAI 410 deprecation, Responses API migration, syntax highlighting#138

Open
doxycomp wants to merge 8 commits intosuperagent-ai:mainfrom
doxycomp:feature/responses-api-migration
Open

fix: xAI 410 deprecation, Responses API migration, syntax highlighting#138
doxycomp wants to merge 8 commits intosuperagent-ai:mainfrom
doxycomp:feature/responses-api-migration

Conversation

@doxycomp
Copy link

Summary

Addresses the xAI 410 deprecation (Live Search) and migrates to the xAI Responses API. Adds syntax highlighting for code in chat and diffs.

Changes

1. xAI 410 Deprecation

  • Problem: API returned 410 "Live search is deprecated. Please switch to the Agent Tools API".
  • Solution: Removed all search_parameters from API requests.
  • Files: src/grok/client.ts, src/agent/grok-agent.ts
  • Removed: SearchParameters, SearchOptions, shouldUseSearchFor().

2. xAI Responses API Migration

  • Automatically uses Responses API when base URL is xAI (x.ai / api.x.ai).
  • chat() and chatStream() use responses.create with correct input/output mapping.
  • Stateful: store: true, previous_response_id for continuing chats without full history.
  • Native tools: web_search and x_search on every request.
  • Tool calls (incl. MCP) handled via function_call / function_call_output.

3. Syntax Highlighting

  • Chalk-based highlighter in src/ui/utils/code-colorizer.tsx for JS/TS, Python, Bash, JSON.
  • Chat file contents and diff lines highlighted.
  • getLanguageFromFilename() for language detection from filenames.

4. Dependencies

  • OpenAI SDK: upgraded to ^6.17.0 for xAI compatibility.
  • MCP SDK: kept at ^1.17.0 (1.25+ has breaking changes).
  • Added globals for ESLint flat config.

5. Other

  • New eslint.config.js flat config.
  • .gitignore: .gemini/, .cursor/* (with !.cursor/context.md).
  • Documentation: docs/xai-responses-api-migration.md, README section.

Patrick Walther and others added 8 commits February 10, 2026 10:48
…ade OpenAI SDK

- Remove search_parameters to fix xAI 410 deprecation (Agent Tools API)

- Add chalk-based syntax highlighting for chat file contents and diffs

- Upgrade OpenAI SDK to ^6.17.0

- Add docs/xai-responses-api-migration.md and README link

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Added .gemini/ and .cursor/* to ignore patterns
- Excluded .cursor/context.md from being ignored
- Updated background colors for added and deleted lines in the diff renderer to use standard color names.
- Removed deprecated chalk-based token rendering in favor of direct Ink color support for better compatibility with Ink's color system.
- Introduced a utility function to validate Ink color names, ensuring only supported colors are used.
- Added `globals` package to devDependencies and updated its version in package-lock.json.
- Updated README and migration documentation to reflect the automatic use of the xAI Responses API.
- Enhanced GrokAgent and GrokClient to support stateful conversations and tool calls with the new API.
- Refactored input handling to clear conversation history effectively.
- Adjusted indentation in the chat interface for improved readability.
- Renamed `colorizeCode` to `colorizeCodeLine` in the diff renderer for clarity.
- Introduced `colorizeCodeLine` function to render individual lines with colored tokens, enhancing inline code display.
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