mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
chore(lint): flatten nested blocks to satisfy max-depth in server
This commit is contained in:
@@ -2288,24 +2288,24 @@ class OpenCodeAgentSession implements AgentSession {
|
||||
} else {
|
||||
let emittedAssistantText = false;
|
||||
for (const part of parts) {
|
||||
if (part.type === "text") {
|
||||
if (part.text) {
|
||||
emittedAssistantText = true;
|
||||
yield {
|
||||
type: "timeline",
|
||||
provider: "opencode",
|
||||
item: { type: "assistant_message", text: part.text },
|
||||
};
|
||||
}
|
||||
} else if (part.type === "reasoning") {
|
||||
if (part.text) {
|
||||
yield {
|
||||
type: "timeline",
|
||||
provider: "opencode",
|
||||
item: { type: "reasoning", text: part.text },
|
||||
};
|
||||
}
|
||||
} else if (part.type === "tool") {
|
||||
if (part.type === "text" && part.text) {
|
||||
emittedAssistantText = true;
|
||||
yield {
|
||||
type: "timeline",
|
||||
provider: "opencode",
|
||||
item: { type: "assistant_message", text: part.text },
|
||||
};
|
||||
continue;
|
||||
}
|
||||
if (part.type === "reasoning" && part.text) {
|
||||
yield {
|
||||
type: "timeline",
|
||||
provider: "opencode",
|
||||
item: { type: "reasoning", text: part.text },
|
||||
};
|
||||
continue;
|
||||
}
|
||||
if (part.type === "tool") {
|
||||
const parsedToolPart = OpencodeToolPartToTimelineItemSchema.safeParse(part);
|
||||
if (parsedToolPart.success && parsedToolPart.data) {
|
||||
yield {
|
||||
|
||||
@@ -1127,10 +1127,7 @@ export class PiDirectAgentSession implements AgentSession {
|
||||
|
||||
if (message.role === "assistant") {
|
||||
for (const content of message.content) {
|
||||
if (content.type === "text") {
|
||||
if (!content.text) {
|
||||
continue;
|
||||
}
|
||||
if (content.type === "text" && content.text) {
|
||||
yield {
|
||||
type: "timeline",
|
||||
provider: PI_PROVIDER,
|
||||
@@ -1139,10 +1136,7 @@ export class PiDirectAgentSession implements AgentSession {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (content.type === "thinking") {
|
||||
if (!content.thinking) {
|
||||
continue;
|
||||
}
|
||||
if (content.type === "thinking" && content.thinking) {
|
||||
yield {
|
||||
type: "timeline",
|
||||
provider: PI_PROVIDER,
|
||||
|
||||
@@ -118,7 +118,7 @@ describe.skipIf(process.platform === "win32")("createWorktree", () => {
|
||||
execSync("git add .", { cwd: varRepoDir });
|
||||
execSync('git -c commit.gpgsign=false commit -m "initial"', { cwd: varRepoDir });
|
||||
|
||||
const result = await createLegacyWorktreeForTest({
|
||||
await createLegacyWorktreeForTest({
|
||||
branchName: "main",
|
||||
cwd: varRepoDir,
|
||||
baseBranch: "main",
|
||||
|
||||
Reference in New Issue
Block a user