| ... | ... | @@ -177,62 +177,11 @@ const makeTildeProviderFixtures = Effect.fn( |
| 177 | 177 | ); |
| 178 | 178 | yield* fileSystem.chmod(codexPath, 0o755); |
| 179 | 179 | |
| 180 | | yield* fileSystem.writeFileString( |
| 180 | yield* fileSystem.copyFile( |
| 181 | yield* path.fromFileUrl( |
| 182 | new URL("./testing/ProviderInstanceRegistryLive.fixture.mjs", import.meta.url), |
| 183 | ), |
| 181 | 184 | claudePath, |
| 182 | | [ |
| 183 | | "#!/usr/bin/env node", |
| 184 | | 'import { existsSync } from "node:fs";', |
| 185 | | 'import * as NodeReadline from "node:readline";', |
| 186 | | 'if (process.argv.includes("--version")) {', |
| 187 | | ' process.stdout.write("claude 2.1.219\\n");', |
| 188 | | " process.exit(0);", |
| 189 | | "}", |
| 190 | | "const lines = NodeReadline.createInterface({ input: process.stdin });", |
| 191 | | 'lines.on("line", (line) => {', |
| 192 | | " const message = JSON.parse(line);", |
| 193 | | ' if (message.type !== "control_request") return;', |
| 194 | | ' if (message.request?.subtype === "get_usage") {', |
| 195 | | " const marker = process.env.T3_CLAUDE_RESET_MARKER;", |
| 196 | | " if (process.env.T3_CLAUDE_USAGE_FAILS_AFTER_CLAIM && marker && existsSync(marker)) {", |
| 197 | | " process.stdout.write(JSON.stringify({", |
| 198 | | ' type: "control_response",', |
| 199 | | ' response: { subtype: "error", request_id: message.request_id, error: "usage failed" },', |
| 200 | | ' }) + "\\n");', |
| 201 | | " return;", |
| 202 | | " }", |
| 203 | | " process.stdout.write(JSON.stringify({", |
| 204 | | ' type: "control_response",', |
| 205 | | ' response: { subtype: "success", request_id: message.request_id, response: {', |
| 206 | | ' session: {}, subscription_type: "pro", rate_limits_available: true,', |
| 207 | | " rate_limits: { five_hour: { utilization: marker && existsSync(marker) ? 0 : 100, resets_at: null } },", |
| 208 | | " } },", |
| 209 | | ' }) + "\\n");', |
| 210 | | " return;", |
| 211 | | " }", |
| 212 | | ' if (message.request?.subtype !== "initialize") return;', |
| 213 | | " process.stdout.write(JSON.stringify({", |
| 214 | | ' type: "control_response",', |
| 215 | | " response: {", |
| 216 | | ' subtype: "success",', |
| 217 | | " request_id: message.request_id,", |
| 218 | | " response: {", |
| 219 | | " commands: [], agents: [], models: [],", |
| 220 | | ' output_style: "default", available_output_styles: ["default"],', |
| 221 | | ' account: { email: "test@example.com", subscriptionType: "pro", tokenSource: "oauth" },', |
| 222 | | " },", |
| 223 | | " },", |
| 224 | | ' }) + "\\n");', |
| 225 | | "});", |
| 226 | | "// Stay alive for follow-up control requests, but never outlive the", |
| 227 | | "// parent: the probe aborts the SDK without awaiting the child, so an", |
| 228 | | "// unconditional interval would strand this process until reboot.", |
| 229 | | "const keepAlive = setInterval(() => {}, 1_000);", |
| 230 | | 'lines.on("close", () => {', |
| 231 | | " clearInterval(keepAlive);", |
| 232 | | " process.exit(0);", |
| 233 | | "});", |
| 234 | | "", |
| 235 | | ].join("\n"), |
| 236 | 185 | ); |
| 237 | 186 | yield* fileSystem.chmod(claudePath, 0o755); |
| 238 | 187 | yield* fileSystem.makeDirectory(claudeHomePath); |