Skip to content

chore: bump version to 0.1.30 and enhance message formatting in AI in…#142

Merged
yashdev9274 merged 1 commit into
mainfrom
supercode-cli
Jun 30, 2026
Merged

chore: bump version to 0.1.30 and enhance message formatting in AI in…#142
yashdev9274 merged 1 commit into
mainfrom
supercode-cli

Conversation

@yashdev9274

@yashdev9274 yashdev9274 commented Jun 30, 2026

Copy link
Copy Markdown
Owner

…teractions

  • Updated package version to 0.1.30.
  • Improved message formatting in AI chat requests to handle null and undefined content, ensuring more robust message construction.
  • Added support for including tool calls and tool call IDs in messages for enhanced context in AI interactions.

Summary by CodeRabbit

  • Bug Fixes

    • Improved chat streaming requests so message content is handled more reliably when empty or missing.
    • Preserved tool-related message details when sending conversations to AI providers, helping tool-enabled chats work more consistently.
  • Chores

    • Updated the server package version to 0.1.30.

…teractions

- Updated package version to 0.1.30.
- Improved message formatting in AI chat requests to handle null and undefined content, ensuring more robust message construction.
- Added support for including tool calls and tool call IDs in messages for enhanced context in AI interactions.

@greptile-apps greptile-apps 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.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
supercli Ready Ready Preview, Comment Jun 30, 2026 4:28pm
supercli-client Ready Ready Preview, Comment Jun 30, 2026 4:28pm
supercli-docs Ready Ready Preview, Comment Jun 30, 2026 4:28pm

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Message construction for the openrouter, nvidia, and concentrateai providers is updated to forward tool_calls and tool_call_id fields when present on incoming messages, and to normalize null/undefined content to an empty string. The package version is bumped to 0.1.30.

Changes

Tool call metadata forwarding across providers

Layer / File(s) Summary
Tool call fields forwarded in provider message mappings
apps/supercode-cli/server/src/cli/ai/openrouter-service.ts, apps/supercode-cli/server/src/index.ts, apps/supercode-cli/server/package.json
All three provider message mappings (openrouter, nvidia, concentrateai) now include tool_calls and tool_call_id when present and normalize content to "" for null/undefined. Package version bumped to 0.1.30.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • yashdev9274/supercli#129: Also modifies openrouter-service.ts and index.ts to handle tool_calls accumulation and tool-call metadata in the CLI AI chat flow.
  • yashdev9274/supercli#130: Modifies the same three provider branches in /api/ai/chat to reshape tool-related payload fields for openrouter, nvidia, and concentrateai.
  • yashdev9274/supercli#115: Refactors the OpenRouter streaming integration and tool-call processing logic in the same index.ts chat endpoint.

Poem

🐇 Hop hop, the tool calls flow,
No field left behind in the snow!
tool_call_id tags along for the ride,
With tool_calls tucked safely inside.
Empty strings where null used to be—
The rabbit sends payloads perfectly! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main changes: a version bump and improved AI message formatting.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch supercode-cli

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
apps/supercode-cli/server/src/index.ts (1)

255-263: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the repeated message-mapping into a shared helper.

These three blocks (openrouter, nvidia, concentrateai branches) are byte-for-byte identical. Duplicating the normalization/forwarding logic across providers risks them drifting apart on future edits. Consider a single helper, e.g.:

const toProviderMessage = (m: any) => {
  const msg: any = {
    role: m.role,
    content: m.content !== null && m.content !== undefined ? String(m.content) : "",
  }
  if (m.tool_calls) msg.tool_calls = m.tool_calls
  if (m.tool_call_id) msg.tool_call_id = m.tool_call_id
  return msg
}
// ...
messages: nonSystemMessages.map(toProviderMessage),

This is also identical to the mapping in openrouter-service.ts (lines 75–83), so a shared module-level util would remove duplication across files.

Also applies to: 404-412, 512-520

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/supercode-cli/server/src/index.ts` around lines 255 - 263, Extract the
repeated nonSystemMessages mapping logic into a shared helper instead of
duplicating the same normalization in the openrouter, nvidia, and concentrateai
branches. Create a reusable message converter (for example, a module-level
helper alongside the code in index.ts, or a shared util used by
openrouter-service.ts as well) that builds the provider message object with
role, stringified content, and optional tool_calls/tool_call_id, then use it in
each branch via messages: nonSystemMessages.map(helperName). Keep the helper
name and call sites aligned so future edits only need to be made in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/supercode-cli/server/src/index.ts`:
- Around line 255-263: Extract the repeated nonSystemMessages mapping logic into
a shared helper instead of duplicating the same normalization in the openrouter,
nvidia, and concentrateai branches. Create a reusable message converter (for
example, a module-level helper alongside the code in index.ts, or a shared util
used by openrouter-service.ts as well) that builds the provider message object
with role, stringified content, and optional tool_calls/tool_call_id, then use
it in each branch via messages: nonSystemMessages.map(helperName). Keep the
helper name and call sites aligned so future edits only need to be made in one
place.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6bd671d2-f293-4548-a028-671773ae5ace

📥 Commits

Reviewing files that changed from the base of the PR and between 4e9c13f and 7600c74.

📒 Files selected for processing (3)
  • apps/supercode-cli/server/package.json
  • apps/supercode-cli/server/src/cli/ai/openrouter-service.ts
  • apps/supercode-cli/server/src/index.ts

@coderabbitai coderabbitai Bot mentioned this pull request Jul 8, 2026
14 tasks
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