test(connector-id): migrate fixtures and assertions to pi-mono ids

Replaces legacy adapter ids (codex_local / claude_local / gemini_local /
claude_compatible) across ~42 test files with pi-mono equivalents:
- codex_local → openai-codex
- claude_local → claude-pro
- gemini_local → gemini-cli
- claude_compatible → anthropic

Hand-rewrites where fixture semantics changed:
- connector-matching: TASK_TYPE_PREFERENCE ordering rebased (claude-pro
  first for code/content/management; google first for research)
- connector-model-policy: getModels(provider) from pi-ai instead of the
  deleted adapter.module.models array
- session-management + edge-case-session: adapter exemption removed;
  rotation now uniform under pi-mono
- ipc-core-admin-handlers: CSV compat model replaced with pi-ai anthropic
- connectors.spec: lookup by openai-codex id (catalog now starts with claude-pro)
- onboarding-model-pool: listProviderModels(provider) helper; label text
  changed to "ChatGPT Plus/Pro (Codex)"
- database integration: added vault insecure-fallback env + electron mock
- command-paths: uses new @main/connector-helpers normalizeCommandValue
- pi-mono-migrations: added `as string` casts for 3 negative-existence
  assertions verifying legacy ids were removed

Drops:
- pnpm-workspace.yaml packages: [] (was "packages/*"; directory empty)
- obsolete CONNECTOR_STRENGTHS import; .module.models probing

Verification:
- pnpm typecheck → 0 errors
- pnpm lint → 0 errors / 0 warnings
- pnpm build:verify → 0 errors / 0 warnings
- pnpm test:unit → 508/508 pass
- pnpm test:integration → 96/96 pass
- All 6 adapter hard gates pass (NOT FOUND / 0 matches / empty)
- pi-ai / pi-agent-core / pi-coding-agent all resolved @0.67.6
This commit is contained in:
ZacharyZhang-NY committed 2026-04-17 02:36:53 -04:00
1 parent 4de9cd0339
commit e94939a562
80 files changed
+2210 -413

No files matched your search

@@ -65,7 +65,7 @@ describe("Step 4: Hire approval + decideApproval", () => {
type: "hire_agent",
payloadSummary: "Hire CTO",
impactSummary: "Test",
payloadJson: JSON.stringify({ agentId: hireId, config: { connector: "codex_local" } }),
payloadJson: JSON.stringify({ agentId: hireId, config: { connector: "openai-codex" } }),
});
const approval = shared.db.getApprovalRecord(approvalId);
@@ -91,13 +91,13 @@ describe("Agent Messages", () => {
beforeEach(() => {
agentAId = shared.db.saveAgent({
companyId: shared.companyId, name: "Alice", role: "Engineer", title: "Senior Engineer",
department: "engineering", connectorId: "claude_local", status: "active",
department: "engineering", connectorId: "claude-pro", status: "active",
capabilities: "Backend development, API design, code review",
budgetMonthlyUsd: 100,
});
agentBId = shared.db.saveAgent({
companyId: shared.companyId, name: "Bob", role: "Designer", title: "UX Designer",
department: "design", connectorId: "claude_local", status: "active",
department: "design", connectorId: "claude-pro", status: "active",
capabilities: "UI design, wireframing, user research",
budgetMonthlyUsd: 100,
});
@@ -242,13 +242,13 @@ describe("Auto Task Assignment", () => {
beforeEach(() => {
backendId = shared.db.saveAgent({
companyId: shared.companyId, name: "Backend Dev", role: "Backend Engineer", title: "Senior Backend",
department: "engineering", connectorId: "codex_local", status: "active",
department: "engineering", connectorId: "openai-codex", status: "active",
capabilities: "API development, database design, Node.js, PostgreSQL, backend testing",
budgetMonthlyUsd: 200,
});
frontendId = shared.db.saveAgent({
companyId: shared.companyId, name: "Frontend Dev", role: "Frontend Engineer", title: "Senior Frontend",
department: "engineering", connectorId: "codex_local", status: "active",
department: "engineering", connectorId: "openai-codex", status: "active",
capabilities: "React, TypeScript, CSS, Tailwind, responsive design, frontend testing, UI components",
budgetMonthlyUsd: 200,
});
@@ -290,8 +290,8 @@ describe("Auto Task Assignment", () => {
it("returns null if all agents have exhausted their budget", () => {
// Set positive budgets that are fully spent
shared.db.saveAgent({ id: backendId, companyId: shared.companyId, name: "Backend Dev", role: "Backend", title: "Backend", connectorId: "codex_local", status: "active", capabilities: "backend", budgetMonthlyUsd: 100 });
shared.db.saveAgent({ id: frontendId, companyId: shared.companyId, name: "Frontend Dev", role: "Frontend", title: "Frontend", connectorId: "codex_local", status: "active", capabilities: "frontend", budgetMonthlyUsd: 100 });
shared.db.saveAgent({ id: backendId, companyId: shared.companyId, name: "Backend Dev", role: "Backend", title: "Backend", connectorId: "openai-codex", status: "active", capabilities: "backend", budgetMonthlyUsd: 100 });
shared.db.saveAgent({ id: frontendId, companyId: shared.companyId, name: "Frontend Dev", role: "Frontend", title: "Frontend", connectorId: "openai-codex", status: "active", capabilities: "frontend", budgetMonthlyUsd: 100 });
// Exhaust budgets by recording spending via direct SQL (since finishRun would need a real run)
(shared.db as unknown as { db: { prepare: (sql: string) => { run: (...args: unknown[]) => void } } }).db.prepare("update agents set spent_monthly_usd = 100 where id = ?").run(backendId);
(shared.db as unknown as { db: { prepare: (sql: string) => { run: (...args: unknown[]) => void } } }).db.prepare("update agents set spent_monthly_usd = 100 where id = ?").run(frontendId);
@@ -28,7 +28,7 @@ describe("Step 7: Worker crash recovery (database layer)", () => {
taskId,
agentId,
workspaceId: shared.workspaceId,
connectorId: "codex_local",
connectorId: "openai-codex",
});
shared.db.markRunStatus(run.id, "running", "Started");
@@ -66,7 +66,7 @@ describe("Step 7: Worker crash recovery (database layer)", () => {
taskId,
agentId,
workspaceId: shared.workspaceId,
connectorId: "codex_local",
connectorId: "openai-codex",
});
shared.db.markRunStatus(run.id, "running", "Started");
@@ -27,7 +27,7 @@ describe("Step 6: Run failure escalation (database layer)", () => {
taskId,
agentId,
workspaceId: shared.workspaceId,
connectorId: "codex_local",
connectorId: "openai-codex",
});
shared.db.markRunStatus(run.id, "running", "Started");
@@ -88,7 +88,7 @@ export function installSharedSetup(): SharedHandle {
title: "Test",
status: "idle",
reportsTo: null,
connectorId: "codex_local",
connectorId: "openai-codex",
workspaceId: state.workspaceId,
model: null,
capabilities: "Test capabilities",