Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/npm-app-release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
new-version: ${{ needs.prepare-and-commit-staging.outputs.new_version }}
artifact-name: updated-staging-package
checkout-ref: ${{ github.event.pull_request.head.sha }}
env-overrides: '{"NEXT_PUBLIC_CB_ENVIRONMENT": "prod", "NEXT_PUBLIC_CODEBUFF_BACKEND_URL": "backend-pr-221-we0m.onrender.com"}'
env-overrides: '{"NEXT_PUBLIC_CB_ENVIRONMENT": "prod", "NEXT_PUBLIC_CODEBUFF_BACKEND_URL": "backend-pr-311-2xab.onrender.com"}'
secrets: inherit

# Create GitHub prerelease with all binaries
Expand Down
1 change: 1 addition & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
},
"dependencies": {
"@ai-sdk/google-vertex": "3.0.6",
"benchify": "^0.1.0-alpha.41",
"@ai-sdk/openai": "2.0.11",
"@codebuff/billing": "workspace:*",
"@codebuff/common": "workspace:*",
Expand Down
23 changes: 23 additions & 0 deletions backend/src/process-str-replace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,22 @@ export async function processStrReplace(
}
| { tool: 'str_replace'; path: string; error: string }
> {
logger.debug(
{
path,
replacementsCount: replacements.length,
},
'processStrReplace: Starting to process str_replace',
)

const initialContent = await initialContentPromise
if (initialContent === null) {
logger.warn(
{
path,
},
'processStrReplace: File does not exist',
)
return {
tool: 'str_replace',
path,
Expand All @@ -31,6 +45,15 @@ export async function processStrReplace(
}
}

logger.debug(
{
path,
initialContentLength: initialContent.length,
hasContent: !!initialContent,
},
'processStrReplace: Successfully read initial file content',
)

// Process each old/new string pair
let currentContent = initialContent
let messages: string[] = []
Expand Down
24 changes: 22 additions & 2 deletions backend/src/run-agent-step.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,22 @@ export const runAgentStep = async (

const stream = getStream(messagesWithSystem(agentMessages, system))

logger.info(
{
agentStepId,
userInputId,
agentType,
agentId: agentState.agentId,
},
'run-agent-step: About to call processStreamWithTools',
)

const {
toolCalls,
toolResults: newToolResults,
state,
fullResponse: fullResponseAfterStream,
fullResponseChunks,
messageId,
} = await processStreamWithTools({
stream,
ws,
Expand All @@ -314,6 +323,17 @@ export const runAgentStep = async (
onResponseChunk,
fullResponse,
})

logger.info(
{
agentStepId,
userInputId,
toolCallsCount: toolCalls.length,
toolResultsCount: newToolResults.length,
toolCallTypes: toolCalls.map((tc) => tc.toolName),
},
'run-agent-step: Completed processStreamWithTools',
)
toolResults.push(...newToolResults)

fullResponse = fullResponseAfterStream
Expand Down Expand Up @@ -403,7 +423,7 @@ export const runAgentStep = async (
agentState,
fullResponse,
shouldEndTurn,
messageId,
messageId: null,
}
}

Expand Down
Loading