Skip to content

Commit 24f63b7

Browse files
V48 Gate 3 (implementation-only): grok-build-0.1 default, one DIV pass, empty-obf skip
Default xAI model to grok-build-0.1; set SynthesizeAssetPacks maxIterations to 1; raise LLM call timeout default to 180s and stall UI to match; skip Setup input-comprehension LLM when Obfuscations are empty (no monorepo thrash).
1 parent 0af667d commit 24f63b7

8 files changed

Lines changed: 84 additions & 21 deletions

File tree

packages/agent-generics/src/execution/AgentLLMsRegistry.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ import { Execution } from '@bitcode/execution-generics/Execution';
2020
* synthesis indefinitely (QA: a deposit run stuck for minutes on one
2121
* structured-output call). On timeout the call rejects and the failsafe/PTRR
2222
* retry handles it (a clean failure, never an indefinite hang). Tunable via
23-
* BITCODE_LLM_CALL_TIMEOUT_MS (default 90000); set 0 to disable the bound.
23+
* BITCODE_LLM_CALL_TIMEOUT_MS (default 180000 for monorepo deposit chunks);
24+
* set 0 to disable the bound.
2425
*/
2526
function resolveLlmCallTimeoutMs(): number {
2627
const raw = Number(process?.env?.BITCODE_LLM_CALL_TIMEOUT_MS);
2728
if (Number.isFinite(raw)) return raw > 0 ? raw : 0;
28-
return 90_000;
29+
return 180_000;
2930
}
3031

3132
async function callLlmWithTimeout(call: Promise<LLMOutput>, model: string): Promise<LLMOutput> {
@@ -177,8 +178,17 @@ export class AgentLLMsRegistry extends RegistryImpl<LLMConfig> {
177178
*/
178179
private wrapWithExecutionTracking(llm: LLM, configKey: string): LLM {
179180
return async (input: LLMInput): Promise<LLMOutput> => {
180-
// Create child execution for this LLM call
181-
const model = input.config?.model || 'unknown';
181+
// Prefer call-site model, then registered hierarchy config (avoids "unknown"
182+
// timeout banners when the provider config is only on the registry path).
183+
const registered = this.findConfigInHierarchy(configKey) || this.findConfigInHierarchy('default');
184+
const model =
185+
(typeof input.config?.model === 'string' && input.config.model.trim()
186+
? input.config.model.trim()
187+
: null) ||
188+
(typeof registered?.model === 'string' && registered.model.trim()
189+
? registered.model.trim()
190+
: null) ||
191+
'unknown';
182192
const llmExec = this.execution.child(`llm:${configKey}:${model}`);
183193

184194
// Track execution

packages/generic-llms/src/defaults.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export function resolveDefaultLLMModel(
3131
switch (provider.toLowerCase()) {
3232
case 'xai':
3333
case 'grok':
34-
return 'grok-4.5';
34+
// Product default: grok-build-0.1 (overridable via BITCODE_LLM_MODEL).
35+
return 'grok-build-0.1';
3536
case 'google':
3637
return 'gemini-2.5-flash';
3738
case 'anthropic':

packages/generic-llms/src/providers/xai.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import { LLMProvider, LLMConfig, LLMInput, LLMOutput } from '@bitcode/llm-generi
44
* xAI / Grok provider — OpenAI-compatible client against https://api.x.ai/v1.
55
*
66
* Auth: XAI_API_KEY (preferred) or GROK_API_KEY.
7-
* Default model: grok-4.5 (overridable via BITCODE_LLM_MODEL).
7+
* Default model: grok-build-0.1 (overridable via BITCODE_LLM_MODEL).
88
*
99
* Uses chat.completions (OpenAI-compatible surface on xAI). The Responses API
1010
* is also available on the same base URL; chat is sufficient for Bitcode's
1111
* message-shaped LLMInput.
1212
*/
1313

1414
const XAI_BASE_URL = 'https://api.x.ai/v1';
15-
const DEFAULT_XAI_MODEL = 'grok-4.5';
15+
const DEFAULT_XAI_MODEL = 'grok-build-0.1';
1616

1717
function resolveXaiApiKey(env: NodeJS.ProcessEnv = process.env): string | undefined {
1818
const key = env.XAI_API_KEY || env.GROK_API_KEY;

packages/generic-llms/tests/unit/registry.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('factoryLLMRegistryWithProviders', () => {
4747

4848
expect(defaults).toEqual({
4949
provider: 'xai',
50-
model: 'grok-4.5',
50+
model: 'grok-build-0.1',
5151
});
5252
});
5353

packages/pipelines-generics/src/execution/PipelineLLMRegistry.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ import { Execution } from '@bitcode/execution-generics/Execution';
1818
* Pipeline LLM calls must be time-bounded — the provider SDK sets no short
1919
* timeout, so a hung/very-slow generation stalls the entire inline synthesis.
2020
* On timeout the call rejects and the failsafe/PTRR retry handles it. Tunable
21-
* via BITCODE_LLM_CALL_TIMEOUT_MS (default 90000); set 0 to disable.
21+
* via BITCODE_LLM_CALL_TIMEOUT_MS (default 180000 for monorepo deposit chunks);
22+
* set 0 to disable.
2223
*/
2324
function resolveLlmCallTimeoutMs(): number {
2425
const raw = Number(process?.env?.BITCODE_LLM_CALL_TIMEOUT_MS);
2526
if (Number.isFinite(raw)) return raw > 0 ? raw : 0;
26-
return 90_000;
27+
return 180_000;
2728
}
2829

2930
async function callLlmWithTimeout(call: Promise<LLMOutput>, model: string): Promise<LLMOutput> {

packages/pipelines/asset-pack/src/__tests__/deposit-setup-discovery-agents.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,31 @@ describe('deposit Setup input-comprehension agent (boundary-mocked PTRR)', () =>
127127
expect(exec.get('setup', 'obfuscationComprehension')).toEqual(MOCK_OBFUSCATION_COMPREHENSION);
128128
expect(getBoundaryLLMCalls().length).toBeGreaterThan(0);
129129
}, 30000);
130+
131+
it('skips LLM when Obfuscations are empty (no monorepo inventory thrash / timeout)', async () => {
132+
resetBoundaryLLMCalls();
133+
const exec = new Execution('setup-node-empty-obfuscations');
134+
const out = await runDepositInputComprehensionAgent(
135+
{
136+
...DEPOSIT_INPUT,
137+
obfuscations: '',
138+
},
139+
exec,
140+
);
141+
142+
expect(out.success).toBe(true);
143+
expect(out.comprehensionMode).toBe('empty-obfuscations-skip-llm');
144+
expect(out.comprehension).toMatchObject({
145+
obfuscatedPaths: [],
146+
obfuscatedConcepts: [],
147+
honorNotes: [],
148+
});
149+
expect(out.comprehension.summary).toMatch(/No explicit obfuscations/i);
150+
expect(exec.get('setup', 'inputComprehension')).toEqual(out.comprehension);
151+
expect(exec.get('setup', 'obfuscationComprehension')).toEqual(out.comprehension);
152+
// Zero provider calls — this is the fix for empty-obfuscation deposit timeouts.
153+
expect(getBoundaryLLMCalls().length).toBe(0);
154+
});
130155
});
131156

132157
describe('deposit Discovery lens agents (boundary-mocked PTRR)', () => {

packages/pipelines/asset-pack/src/agents/setup/deposit-input-comprehension-agent.ts

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,42 @@ function findValue(execution: any, namespace: string, key: string): any {
103103
return execution?.findUp?.(namespace, key);
104104
}
105105

106+
const EMPTY_OBFUSCATION_COMPREHENSION: DepositObfuscationComprehension = {
107+
summary:
108+
'No explicit obfuscations declared; synthesis honors the protected-IP exclusions as authoritative.',
109+
obfuscatedPaths: [],
110+
obfuscatedConcepts: [],
111+
honorNotes: [],
112+
};
113+
114+
function hasDeclaredObfuscations(value: unknown): boolean {
115+
return typeof value === 'string' && value.trim().length > 0;
116+
}
117+
106118
export default async function runDepositInputComprehensionAgent(input: any, execution: any) {
107119
const obfuscations = input?.obfuscations ?? findValue(execution, 'deposit', 'obfuscations') ?? null;
108120
const repository = input?.repository ?? findValue(execution, 'deposit', 'repository') ?? {};
109121
const inventory = input?.inventory ?? findValue(execution, 'deposit', 'inventory');
110122

123+
// Empty Obfuscations: no LLM work. Full monorepo inventory + PTRR plan/try
124+
// against blank text was burning minutes and timing out (90s per call) with
125+
// nothing to map. Protected-IP exclusions remain authoritative downstream.
126+
if (!hasDeclaredObfuscations(obfuscations)) {
127+
storeCrossPhaseArtifact(execution, 'setup', 'inputComprehension', EMPTY_OBFUSCATION_COMPREHENSION);
128+
storeCrossPhaseArtifact(
129+
execution,
130+
'setup',
131+
'obfuscationComprehension',
132+
EMPTY_OBFUSCATION_COMPREHENSION,
133+
);
134+
return {
135+
...(input || {}),
136+
success: true,
137+
comprehension: EMPTY_OBFUSCATION_COMPREHENSION,
138+
comprehensionMode: 'empty-obfuscations-skip-llm',
139+
};
140+
}
141+
111142
// Prompt path: paths + samples only. Full inventory.sources stays on the
112143
// shared execution store for measurement; never enter PTRR user prompts
113144
// (JSON.stringify of monorepo sources → Invalid string length).
@@ -126,13 +157,8 @@ export default async function runDepositInputComprehensionAgent(input: any, exec
126157
// unwrap it to the agent's typed structured output (F27).
127158
const result = (raw as any)?.finalOutput ?? (raw as any)?.output ?? raw;
128159

129-
const comprehension: DepositObfuscationComprehension = (result as any)?.comprehension ?? {
130-
summary:
131-
'No explicit obfuscations declared; synthesis honors the protected-IP exclusions as authoritative.',
132-
obfuscatedPaths: [],
133-
obfuscatedConcepts: [],
134-
honorNotes: [],
135-
};
160+
const comprehension: DepositObfuscationComprehension =
161+
(result as any)?.comprehension ?? EMPTY_OBFUSCATION_COMPREHENSION;
136162

137163
// Cross-phase artifacts: the Implementation synthesis agent and the deposit
138164
// Validation agent read this obfuscation guidance from OTHER phase siblings,

uapi/components/base/bitcode/execution/pipeline-execution-log.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,10 @@ export function buildTerseLogCopyText(args: {
537537
}
538538

539539
// Matches the default BITCODE_LLM_CALL_TIMEOUT_MS (AgentLLMsRegistry /
540-
// PipelineLLMRegistry) — past this many seconds with no new row, an in-flight
541-
// LLM call should already have timed out server-side, so continued silence is
542-
// a genuine-hang signal rather than a merely slow generation.
543-
const LIKELY_STALL_SECONDS = 90;
540+
// PipelineLLMRegistry, 180s) — past this many seconds with no new row, an
541+
// in-flight LLM call should already have timed out server-side, so continued
542+
// silence is a genuine-hang signal rather than a merely slow generation.
543+
const LIKELY_STALL_SECONDS = 180;
544544

545545
/**
546546
* Build the live "While {Depositing|Reading}, during {Phase}, {Agent} Agent is

0 commit comments

Comments
 (0)