Repository navigation
perf(integration): switch to gpt-6.2-sol low, pre-install AIO skill, and isolate linear Task tools - #1617
perf(integration): switch to gpt-6.2-sol low, pre-install AIO skill, and isolate linear Task tools#1617gewenyu99 wants to merge 6 commits into
Conversation
…m orchestrator and register gpt-6.2-sol
…off Terra onto gpt-6.2-sol low
|
Non-stalled runs cut wall-clock time by 16% to 33% on Integration benchmarks
Standalone AIO benchmarks
The 600s stall4 of 10 |
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a Context Mill branch:
Add Results will be posted here when complete. |
| export const GPT5_6_SOL_MODEL = 'openai/gpt-5.6-sol'; | ||
| export const GPT6_SOL_MODEL = 'openai/gpt-6-sol'; | ||
| export const GPT6_2_SOL_MODEL = 'openai/gpt-6.2-sol'; | ||
|
|
There was a problem hiding this comment.
Added gpt-6.2-sol to wizard-gateway-allowlist (flag 960134, v7). Follow up in PostHog/posthog to add it to WIZARD_DEFAULT_MODELS in posthog/llm/wizard_gateway_token.py.
| model_pi: openai/gpt-5.6-sol | ||
| effort_pi: medium | ||
| model_pi: openai/gpt-6.2-sol | ||
| effort_pi: low |
There was a problem hiding this comment.
wizard-orchestrator-override (flag 779412, 100% sol-review) overrides review to gpt-5.6-sol medium in prod, so turn it off or update it on rollout.
… fast path, and make pre-install optional
|
✅ Security review complete — 1 finding posted as a review, in 9 min. Add the |
| } | ||
| }; | ||
|
|
||
| const req = readProjectFile(join(installDir, 'requirements.txt')); |
There was a problem hiding this comment.
A symlinked manifest can block AI Observability preflight indefinitely
non-security-availability (confidence 5/5)
Details
config.run in src/programs/ai-observability/index.ts:65-66 now invokes this resolver synchronously, and detectUnambiguousAioSkill calls parsePyDeps even for Node-only projects. These manifest reads use readProjectFile, whose implementation at src/shared/utils/bounded-fs.ts:302-303 follows symlinks and checks only stat.size before readFileSync. Pipes and terminal devices report size zero, so the byte cap does not bound the read. The preceding discovery walk skips symlinks; its protection does not carry over to these new direct reads.
Impact — a repository writer can add requirements.txt -> /dev/stdin alongside a normal package.json declaring openai. Running wizard ai-observability in an interactive terminal then blocks the main thread before skill installation or the optional fallback. An offline probe of the copied resolver on a real PTY remained blocked after 1.5 seconds and returned only after terminal EOF. Ordinary asynchronous cancellation cannot execute while this synchronous read is blocked. This affects the local run's availability, not credential or tenant isolation.
Fix — use the existing safeReadFile helper for all three root manifests, or otherwise reject non-regular targets before reading and enforce a bounded read. Add a regression test for a symlink to a terminal or FIFO so this optional optimization falls back rather than blocking.
There was a problem hiding this comment.
Fixed in 4ab3fc0. Switched detect-skill.ts manifest and scan reads to safeReadFile, added the same stat.isFile() guard to readProjectFile, and added a FIFO symlink regression test.
johncwaters
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
On rollout order: the model switch has no automatic fallback in code. posthog-integration and ai-observability hardcode GPT6_2_SOL_MODEL at low, and nothing retries on another model or times out an idle stream, so a stalled run still sits for 600s. The new gpt-6-2-sol scheme entry means flag 779412 can steer runs between models without a release, but that is a manual lever, not a fallback. Two parts don't depend on the model and could ship ahead of it: the Task-tool isolation and the batched TaskUpdate prompt changes. The AIO pre-install needs the routing fixes in the inline comments first.
See inline comments.
Automated review by Glimmervoid. Not written by a human
| parseRequirementsTxt, | ||
| } from '@services/project-discovery'; | ||
|
|
||
| const NODE_FRAMEWORK_SKILLS: ReadonlyArray<readonly [string, string]> = [ |
There was a problem hiding this comment.
[architecture/twin-logic] HIGH
This table copies context-mill's AIO routing (ai-observability/references/1-begin.md) into the wizard, and the copy has already drifted. 1-begin.md:42 maps both mastra and @mastra/core to the Mastra variant, but line 30 here only knows @mastra/core, so a project with {mastra, openai} gets ai-observability-openai-node pre-installed. Azure has the same problem: config.yaml ships azure-openai-node and azure-openai-python, those projects use the plain openai package, and GATEWAY_OVERRIDE_RE doesn't match azure_endpoint, so they get the plain OpenAI skill plus a prompt telling the agent to skip load_skill_menu.
Nothing checks this copy against context-mill, and released wizards keep the old routing after every context-mill release. Could the package-to-variant mapping live in context-mill instead, as a packages: field per variant in config.yaml compiled into skill-menu.json? The wizard already fetches that menu, so it could resolve from it and keep only the ambiguity guards locally. If that's too big for this PR, add the mastra and Azure cases and treat the menu move as a follow-up.
Automated review by Glimmervoid. Not written by a human
There was a problem hiding this comment.
Fixed the drift in 4ab3fc0. Added unscoped mastra to NODE_FRAMEWORK_SKILLS and added Azure OpenAI signals (AzureOpenAI, azure_endpoint, AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY, openai.azure.com) to GATEWAY_OVERRIDE_RE so Azure projects fall back to the menu. Moving the package mapping into context-mill's skill-menu.json is left as a follow-up.
| docsUrl: 'https://posthog.com/docs/ai-observability', | ||
| spinnerMessage: 'Setting up AI Observability...', | ||
| estimatedDurationMinutes: 5, | ||
| run: (session) => { |
There was a problem hiding this comment.
[convergent: code/contract + redteam/signal + architecture/one-way-compat] MEDIUM
Making run a function drops the AIO docs link from three readers that only check object-form runs: src/headless/run.ts:241, src/tui/services/wizard-spellbook.ts:75 and src/programs/program-runner/detect-program.ts:158 all do typeof config.run === 'object' ? config.run.docsUrl : undefined. ai-observability never sets session.frameworkConfig, so headless failures and the mint-failure spell book now link to https://posthog.com/docs instead of https://posthog.com/docs/ai-observability. A mint failure is likely while gpt-6.2-sol is still missing from WIZARD_DEFAULT_MODELS. Suggest a static top-level docsUrl on ProgramConfig that all three read, or keeping run an object and resolving the skill in a separate hook.
The 37 literal skill ids also aren't registered in context-mill's scripts/lib/wizard-skill-picks.js, which only lists integration-, spend-audit-, replay-vision-* and posthog-best-practices, so a variant rename passes context-mill's build. Released wizards would then hit skill-not-found, fall back through optionalSkill, and lose the speedup with only a logToFile line to show for it. Adding the ai-observability ids to that registry in the same rollout closes it.
Automated review by Glimmervoid. Not written by a human
There was a problem hiding this comment.
Fixed the docsUrl contract in 4ab3fc0. Added static docsUrl to ProgramConfig (matching reportFile), set it on ai-observability, and updated src/headless/run.ts, src/tui/services/wizard-spellbook.ts, and src/programs/program-runner/detect-program.ts to read it. Registering the ai-observability-* IDs in context-mill's scripts/lib/wizard-skill-picks.js is tracked as a cross-repo follow-up.
| ['portkey-ai', 'ai-observability-portkey-node'], | ||
| ]; | ||
|
|
||
| const PYTHON_FRAMEWORK_SKILLS: ReadonlyArray<readonly [string, string]> = [ |
There was a problem hiding this comment.
[redteam/input-variant] MEDIUM
The header says this returns a skill only for a single unambiguous framework or provider, but split integration packages slip past it. A requirements.txt listing only langchain-openai and openai gives pyFrameworks=[] and pyProviders=['ai-observability-openai-python'], so line 254 pre-installs the raw OpenAI skill and the prompt says to skip the menu. The same happens with langchain-anthropic, langchain-community, llama-index-core, llama-index-llms-openai, and on Node with @langchain/openai.
The prompt does tell the agent to switch variants when a framework wraps the calls, so maybe that's enough. My read is that the resolver should not pre-install the wrong one in the first place: a prefix match on langchain-*, @langchain/* and llama-index-* as a framework hit, or returning undefined when one shows up, keeps the old "prefer the higher abstraction" rule working.
Automated review by Glimmervoid. Not written by a human
There was a problem hiding this comment.
Fixed in 4ab3fc0. Added prefix matching for langchain-*, llama-index-*, @langchain/*, and @llamaindex/* (skipping exact matches like @langchain/langgraph) with unit tests so split packages resolve as frameworks rather than raw providers.
|
|
||
| const GATEWAY_OVERRIDE_RE = | ||
| /\b(OPENAI_BASE_URL|baseURL|base_url)\b|api\.groq\.com|openrouter\.ai|api\.together\.xyz|localhost:11434/; | ||
| const CODE_EXTS = new Set(['.ts', '.tsx', '.js', '.mjs', '.cjs', '.py']); |
There was a problem hiding this comment.
[redteam/bound-fails-open] MEDIUM
The gateway scan can miss the override and still say "no override". .env files are filtered out by CODE_EXTS, and the OpenAI SDKs read OPENAI_BASE_URL straight from the environment, so a project pointing at OpenRouter through .env gets the plain OpenAI skill. .jsx, .mts and .cts are skipped too. On top of that, walkProjectFiles stops at GATEWAY_SCAN_DEPTH = 5 but leaves complete true, so a baseURL six levels deep reads as absent. Suggest scanning .env*, .jsx, .mts and .cts, and treating a depth-truncated walk as incomplete so the resolver falls back to the menu.
Automated review by Glimmervoid. Not written by a human
There was a problem hiding this comment.
Fixed in 4ab3fc0. Gateway scanning now covers .env*, .jsx, .mts, and .cts files, and walkProjectFiles supports incompleteOnDepthLimit: true so depth-truncated trees fall back to the menu.
| ).toEqual(new Set(['read'])); | ||
| }); | ||
|
|
||
| it('never admits linear Task* tools into orchestrator task tool sets', () => { |
There was a problem hiding this comment.
[code/false-proof] MEDIUM
This test passes with the PR's production changes reverted: it asserts on allowedPiCodingTools, allowedPiWizardTools and allowedOrchestratorTools, and this diff changes none of them (no production file under src/agent/runner/harness/pi changes). The Task-tool isolation lives in resolveRunToolLists on the Anthropic SDK path, which initialize-agent.test.ts already covers. Suggest dropping it, or pointing it at code this PR changed.
Automated review by Glimmervoid. Not written by a human
There was a problem hiding this comment.
Fixed in 4ab3fc0. Removed the unchanged pi tool-mapping test from task-tools.test.ts since initialize-agent.test.ts already covers resolveRunToolLists.
…l, and drop unused pi task test
Problem
posthog-integrationandai-observabilityare slow and expensive ongpt-5.6-terra. Runtime skill discovery and soloTaskUpdatecalls waste turns, and linear-onlyTask*tools leak into orchestrator runs.Changes
posthog-integrationshould run ~25% faster (~65% lower LLM cost) and standaloneai-observability~50% faster once the600sstream stall is fixed.posthog-integrationandai-observabilitytogpt-6.2-solatloweffort.ai-observabilityskill when the manifest maps to one framework or provider. Match standalone guardrails to the orchestrator task.Task*tools and task-list instructions to linear runs, and batchTaskUpdatecalls with real work.4 of 10
gpt-6.2-solorchestrator runs hit a600smid-stream stall, so this PR stays in draft (see benchmark comment).Test plan
pnpm typecheck,pnpm build,pnpm test, andpnpm lintpass.v3.0.0against this branch on 6 integration repos and 5 standalone AIO repos (see comment).