Configure lefthook formatter checks (#231)

* Add lefthook formatter checks

* Fix SDK mode hydration

* Stabilize SDK mode integration test
This commit is contained in:
Nathan Flurry 2026-03-10 23:03:11 -07:00 committed by GitHub
parent 0471214d65
commit d2346bafb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
282 changed files with 5840 additions and 8399 deletions

View file

@ -94,10 +94,7 @@ async function main() {
console.log("Native OpenCode server is healthy!");
// 1. Capture initial metadata
const [agentRes, configRes] = await Promise.all([
fetch(`${baseUrl}/agent`).then((r) => r.json()),
fetch(`${baseUrl}/config`).then((r) => r.json()),
]);
const [agentRes, configRes] = await Promise.all([fetch(`${baseUrl}/agent`).then((r) => r.json()), fetch(`${baseUrl}/config`).then((r) => r.json())]);
saveJson("metadata-agent", agentRes);
saveJson("metadata-config", configRes);
@ -186,9 +183,7 @@ async function main() {
await new Promise((r) => setTimeout(r, 1000));
// 5. Get messages after first request
const messagesAfter1 = await fetch(`${baseUrl}/session/${sessionId}/message`).then((r) =>
r.json()
);
const messagesAfter1 = await fetch(`${baseUrl}/session/${sessionId}/message`).then((r) => r.json());
saveJson("messages-after-1", messagesAfter1);
console.log(` Got ${messagesAfter1.length} messages after msg 1`);
@ -218,9 +213,7 @@ async function main() {
await new Promise((r) => setTimeout(r, 2000));
// 7. Get messages after second request
const messagesAfter2 = await fetch(`${baseUrl}/session/${sessionId}/message`).then((r) =>
r.json()
);
const messagesAfter2 = await fetch(`${baseUrl}/session/${sessionId}/message`).then((r) => r.json());
saveJson("messages-after-2", messagesAfter2);
console.log(` Got ${messagesAfter2.length} messages after msg 2`);
@ -239,8 +232,7 @@ async function main() {
// Filter events for this session
const sessionEvents = allEvents.filter(
(e) => e.properties?.sessionID === sessionId ||
(e.type === "session.created" && e.properties?.info?.id === sessionId)
(e) => e.properties?.sessionID === sessionId || (e.type === "session.created" && e.properties?.info?.id === sessionId),
);
saveJson("session-events", sessionEvents);

View file

@ -58,17 +58,13 @@ async function main() {
// Use the locally built binary, not the installed one
const binaryPath = new URL("../../target/release/sandbox-agent", import.meta.url).pathname;
const child: ChildProcess = spawn(
binaryPath,
["server", "--host", host, "--port", String(port), "--token", token],
{
stdio: "pipe",
env: {
...process.env,
SANDBOX_AGENT_SKIP_INSPECTOR: "1",
},
}
);
const child: ChildProcess = spawn(binaryPath, ["server", "--host", host, "--port", String(port), "--token", token], {
stdio: "pipe",
env: {
...process.env,
SANDBOX_AGENT_SKIP_INSPECTOR: "1",
},
});
let stderr = "";
child.stderr?.on("data", (chunk) => {
@ -205,9 +201,7 @@ async function main() {
// Filter session events
const sessionEvents = allEvents.filter(
(e) =>
e.properties?.sessionID === sessionId ||
(e.type === "session.created" && e.properties?.info?.id === sessionId)
(e) => e.properties?.sessionID === sessionId || (e.type === "session.created" && e.properties?.info?.id === sessionId),
);
saveJson("session-events", sessionEvents);
@ -221,12 +215,7 @@ async function main() {
}
}
async function waitForIdle(
opencodeUrl: string,
sessionId: string,
headers: Record<string, string>,
timeoutMs: number
): Promise<void> {
async function waitForIdle(opencodeUrl: string, sessionId: string, headers: Record<string, string>, timeoutMs: number): Promise<void> {
const start = Date.now();
await new Promise((r) => setTimeout(r, 500));
while (Date.now() - start < timeoutMs) {

View file

@ -1278,4 +1278,4 @@
"diff": []
}
}
]
]

View file

@ -49,4 +49,4 @@
}
},
"parts": []
}
}

View file

@ -96,4 +96,4 @@
}
]
}
]
]

View file

@ -278,4 +278,4 @@
}
]
}
]
]

View file

@ -602,4 +602,4 @@
],
"prompt": "Summarize what was done in this conversation. Write like a pull request description.\n\nRules:\n- 2-3 sentences max\n- Describe the changes made, not the process\n- Do not mention running tests, builds, or other validation steps\n- Do not explain what the user asked for\n- Write in first person (I added..., I fixed...)\n- Never ask questions or add new questions\n- If the conversation ends with an unanswered question to the user, preserve that exact question\n- If the conversation ends with an imperative statement or request to the user (e.g. \"Now please run the command and paste the console output\"), always include that exact request in the summary\n"
}
]
]

View file

@ -99,4 +99,4 @@
"terminal_title_toggle": "none",
"tips_toggle": "<leader>h"
}
}
}

View file

@ -4,9 +4,7 @@
"id": "opencode",
"source": "api",
"name": "OpenCode Zen",
"env": [
"OPENCODE_API_KEY"
],
"env": ["OPENCODE_API_KEY"],
"options": {},
"models": {
"glm-4.7": {
@ -272,30 +270,22 @@
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"xhigh": {
"reasoningEffort": "xhigh",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
},
@ -351,23 +341,17 @@
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
},
@ -853,23 +837,17 @@
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
},
@ -976,30 +954,22 @@
"none": {
"reasoningEffort": "none",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
},
@ -1055,30 +1025,22 @@
"minimal": {
"reasoningEffort": "minimal",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
},
@ -1134,23 +1096,17 @@
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
},
@ -1472,23 +1428,17 @@
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
},
@ -1714,30 +1664,22 @@
"minimal": {
"reasoningEffort": "minimal",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
},
@ -1844,37 +1786,27 @@
"none": {
"reasoningEffort": "none",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"xhigh": {
"reasoningEffort": "xhigh",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
}
@ -1885,9 +1817,7 @@
"id": "cerebras",
"source": "api",
"name": "Cerebras",
"env": [
"CEREBRAS_API_KEY"
],
"env": ["CEREBRAS_API_KEY"],
"options": {
"headers": {
"X-Cerebras-3rd-Party-Integration": "opencode"
@ -2054,9 +1984,7 @@
"id": "openai",
"source": "custom",
"name": "OpenAI",
"env": [
"OPENAI_API_KEY"
],
"env": ["OPENAI_API_KEY"],
"options": {
"apiKey": "opencode-oauth-dummy-key"
},
@ -2112,30 +2040,22 @@
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"xhigh": {
"reasoningEffort": "xhigh",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
},
@ -2190,23 +2110,17 @@
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
},
@ -2261,23 +2175,17 @@
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
},
@ -2332,23 +2240,17 @@
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
},
@ -2403,37 +2305,27 @@
"none": {
"reasoningEffort": "none",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"low": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"medium": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"high": {
"reasoningEffort": "high",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
},
"xhigh": {
"reasoningEffort": "xhigh",
"reasoningSummary": "auto",
"include": [
"reasoning.encrypted_content"
]
"include": ["reasoning.encrypted_content"]
}
}
}
@ -2443,9 +2335,7 @@
"id": "anthropic",
"source": "custom",
"name": "Anthropic",
"env": [
"ANTHROPIC_API_KEY"
],
"env": ["ANTHROPIC_API_KEY"],
"options": {
"apiKey": "",
"headers": {
@ -3713,4 +3603,4 @@
"openai": "gpt-5.2-codex",
"anthropic": "claude-sonnet-4-5-20250929"
}
}
}

View file

@ -9,4 +9,4 @@
"created": 1770361012806,
"updated": 1770361012806
}
}
}

View file

@ -14,4 +14,4 @@
"deletions": 0,
"files": 0
}
}
}

View file

@ -153,4 +153,4 @@
"diff": []
}
}
]
]

View file

@ -679,4 +679,4 @@
},
"type": "message.part.updated"
}
]
]

View file

@ -8,4 +8,4 @@
"options": {},
"permission": []
}
]
]

View file

@ -9,4 +9,4 @@
},
"title": "Session ses_1",
"version": "0"
}
}

View file

@ -9,4 +9,4 @@
},
"title": "Session ses_1",
"version": "0"
}
}

View file

@ -652,4 +652,4 @@
},
"type": "message.part.updated"
}
]
]

View file

@ -2,4 +2,4 @@
"ses_1": {
"type": "idle"
}
}
}