mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix(task): include request text in api_req_started for tool detection in e2e tests
This commit is contained in:
parent
c92e855cdf
commit
a4c91a03c1
1 changed files with 10 additions and 0 deletions
|
|
@ -1793,10 +1793,18 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
|
|||
const modelId = getModelId(this.apiConfiguration)
|
||||
const apiProtocol = getApiProtocol(this.apiConfiguration.apiProvider, modelId)
|
||||
|
||||
// Include a summary of the current user request so integration tests can detect tool execution intent.
|
||||
const requestText = currentUserContent
|
||||
.map((block) => (block.type === "text" ? block.text : ""))
|
||||
.filter(Boolean)
|
||||
.join("\n")
|
||||
.trim()
|
||||
|
||||
await this.say(
|
||||
"api_req_started",
|
||||
JSON.stringify({
|
||||
apiProtocol,
|
||||
request: requestText,
|
||||
}),
|
||||
)
|
||||
|
||||
|
|
@ -1834,7 +1842,9 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
|
|||
// message.
|
||||
const lastApiReqIndex = findLastIndex(this.clineMessages, (m) => m.say === "api_req_started")
|
||||
|
||||
const existingApiReqData = JSON.parse(this.clineMessages[lastApiReqIndex].text || "{}")
|
||||
this.clineMessages[lastApiReqIndex].text = JSON.stringify({
|
||||
...existingApiReqData,
|
||||
apiProtocol,
|
||||
} satisfies ClineApiReqInfo)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue