Merge pull request #161 from auriti/fix/block-update-for-3p-providers
fix: block update command for 3P providers, align thinking block handling
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
|
import { getAPIProvider } from 'src/utils/model/providers.js'
|
||||||
import { logEvent } from 'src/services/analytics/index.js'
|
import { logEvent } from 'src/services/analytics/index.js'
|
||||||
import {
|
import {
|
||||||
getLatestVersion,
|
getLatestVersion,
|
||||||
@@ -28,6 +29,19 @@ import { gte } from 'src/utils/semver.js'
|
|||||||
import { getInitialSettings } from 'src/utils/settings/settings.js'
|
import { getInitialSettings } from 'src/utils/settings/settings.js'
|
||||||
|
|
||||||
export async function update() {
|
export async function update() {
|
||||||
|
// Block updates for third-party providers. The update mechanism downloads
|
||||||
|
// from Anthropic's distribution bucket, which would silently replace the
|
||||||
|
// OpenClaude build (with the OpenAI shim) with the upstream Claude Code
|
||||||
|
// binary (without it).
|
||||||
|
if (getAPIProvider() !== 'firstParty') {
|
||||||
|
writeToStdout(
|
||||||
|
chalk.yellow('Auto-update is not available for third-party provider builds.\n') +
|
||||||
|
'To update, pull the latest source from the repository and rebuild:\n' +
|
||||||
|
' git pull && bun install && bun run build\n',
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
logEvent('tengu_update_check', {})
|
logEvent('tengu_update_check', {})
|
||||||
writeToStdout(`Current version: ${MACRO.VERSION}\n`)
|
writeToStdout(`Current version: ${MACRO.VERSION}\n`)
|
||||||
|
|
||||||
|
|||||||
@@ -264,7 +264,8 @@ export function convertAnthropicMessagesToResponsesInput(
|
|||||||
|
|
||||||
if (role === 'assistant') {
|
if (role === 'assistant') {
|
||||||
const textBlocks = Array.isArray(content)
|
const textBlocks = Array.isArray(content)
|
||||||
? content.filter((block: { type?: string }) => block.type !== 'tool_use')
|
? content.filter((block: { type?: string }) =>
|
||||||
|
block.type !== 'tool_use' && block.type !== 'thinking')
|
||||||
: content
|
: content
|
||||||
const parts = convertContentBlocksToResponsesParts(textBlocks, 'assistant')
|
const parts = convertContentBlocksToResponsesParts(textBlocks, 'assistant')
|
||||||
if (parts.length > 0) {
|
if (parts.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user