mirror of
https://github.com/sst/opencode.git
synced 2025-08-22 22:14:14 +00:00
sync
This commit is contained in:
parent
6cf860be84
commit
bc199d32be
1 changed files with 2 additions and 2 deletions
|
@ -461,15 +461,15 @@ async function subscribeSessionEvents() {
|
||||||
let text = ""
|
let text = ""
|
||||||
;(async () => {
|
;(async () => {
|
||||||
while (true) {
|
while (true) {
|
||||||
console.log("!@#!@#!@#! reading...")
|
|
||||||
const { done, value } = await reader.read()
|
const { done, value } = await reader.read()
|
||||||
console.log("!@#!@#!@#! read", done, value)
|
|
||||||
if (done) break
|
if (done) break
|
||||||
|
|
||||||
const chunk = decoder.decode(value, { stream: true })
|
const chunk = decoder.decode(value, { stream: true })
|
||||||
|
console.log("!@#!@#!@#! read", chunk)
|
||||||
const lines = chunk.split("\n")
|
const lines = chunk.split("\n")
|
||||||
|
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
|
console.log("!@#!@#!@#! line", line)
|
||||||
if (!line.startsWith("data: ")) continue
|
if (!line.startsWith("data: ")) continue
|
||||||
|
|
||||||
const jsonStr = line.slice(6).trim()
|
const jsonStr = line.slice(6).trim()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue