Skip to content

Commit 6f30c70

Browse files
refactor: address pr feedback and failing webkit spec.
1 parent 2df935b commit 6f30c70

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

docs/byot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ BYOT controls are available by default. The token is used to:
1313

1414
AI chat no longer uses the GitHub PAT. Chat uses a separate OpenRouter API key.
1515

16-
- OpenRouter key setup for chat: [docs/openrouter-byok.md](docs/openrouter-byok.md)
16+
- OpenRouter key setup for chat: [openrouter-byok.md](openrouter-byok.md)
1717

1818
## Privacy and storage behavior
1919

docs/openrouter-byok.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ OpenRouter free models still require an API key.
3636

3737
## Related docs
3838

39-
- GitHub PAT setup for PR/repository workflows: [docs/byot.md](docs/byot.md)
40-
- Local storage keys: [docs/localstorage-state.md](docs/localstorage-state.md)
39+
- GitHub PAT setup for PR/repository workflows: [byot.md](byot.md)
40+
- Local storage keys: [localstorage-state.md](localstorage-state.md)

playwright/helpers/app-test-helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const isRetryableGotoError = (error: unknown) => {
4545
return false
4646
}
4747

48-
return /WebKit encountered an internal error|Test timeout/i.test(error.message)
48+
return /WebKit encountered an internal error|page\.goto: Timeout/i.test(error.message)
4949
}
5050

5151
const navigateToApp = async (page: Page, path: string) => {

src/modules/chat/request-runner.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ const sanitizeAssistantContent = value => {
1313
return ''
1414
}
1515

16-
return value
17-
.replace(/<\|tool_call_start\|>[\s\S]*?<\|tool_call_end\|>/g, '')
18-
.replace(/<\|tool_call_start\|>|<\|tool_call_end\|>/g, '')
16+
let sanitized = value.replace(/<\|tool_call_start\|>[\s\S]*?<\|tool_call_end\|>/g, '')
17+
18+
const openToolCallIndex = sanitized.indexOf('<|tool_call_start|>')
19+
if (openToolCallIndex !== -1) {
20+
sanitized = sanitized.slice(0, openToolCallIndex)
21+
}
22+
23+
return sanitized.replace(/<\|tool_call_start\|>|<\|tool_call_end\|>/g, '')
1924
}
2025

2126
export const createChatRequestRunner = ({

0 commit comments

Comments
 (0)