probe: Trial D3 — streaming RPC with protocol_version=1 + cascadeId combined

This commit is contained in:
2026-03-07 23:05:54 +09:00
parent 4d1bb7a443
commit 12131b9103
4 changed files with 61 additions and 53 deletions

Binary file not shown.

View File

@@ -476,15 +476,7 @@ function activate(context) {
req.end(); req.end();
}); });
} }
// protobuf: field 1 (protocol_version) = 1 → 0x08 0x01 // Get latest trajectory ID first, then try streams WITH cascadeId
const versionOnly = Buffer.from([0x08, 0x01]);
// Try StreamCascadeReactiveUpdates with version=1
let r = await tryProtoRPC('StreamCascadeReactiveUpdates', versionOnly);
console.log(`Gravity Bridge: [Trial D2] StreamCascade(v1): ${r.substring(0, 600)}`);
// Try StreamCascadeSummariesReactiveUpdates with version=1
r = await tryProtoRPC('StreamCascadeSummariesReactiveUpdates', versionOnly);
console.log(`Gravity Bridge: [Trial D2] StreamSummaries(v1): ${r.substring(0, 600)}`);
// Get latest trajectory ID and try StreamAgentStateUpdates with cascadeId
try { try {
const dRaw = await vscode.commands.executeCommand('antigravity.getDiagnostics'); const dRaw = await vscode.commands.executeCommand('antigravity.getDiagnostics');
const d = typeof dRaw === 'string' ? JSON.parse(dRaw) : dRaw; const d = typeof dRaw === 'string' ? JSON.parse(dRaw) : dRaw;
@@ -492,31 +484,45 @@ function activate(context) {
if (ts.length > 0) { if (ts.length > 0) {
const latest = ts[ts.length - 1]; const latest = ts[ts.length - 1];
const gid = latest.googleAgentId || ''; const gid = latest.googleAgentId || '';
console.log(`Gravity Bridge: [Trial D2] Using trajectory ${gid.substring(0, 8)}`); console.log(`Gravity Bridge: [Trial D3] Using cascade ${gid.substring(0, 8)} step=${latest.lastStepIndex}`);
// Build protobuf with cascadeId string: field 1 = gid
// string field: tag=0x0A (field 1 wire type 2), length, bytes
const gidBuf = Buffer.from(gid, 'utf-8'); const gidBuf = Buffer.from(gid, 'utf-8');
const cascadeProto = Buffer.alloc(2 + gidBuf.length); // Attempt 1: field1=version(varint=1), field2=cascadeId(string)
cascadeProto[0] = 0x0A; // field 1, wire type 2 (length-delimited) // 0x08 0x01 0x12 <len> <cascadeId>
cascadeProto[1] = gidBuf.length; const proto1 = Buffer.alloc(2 + 2 + gidBuf.length);
gidBuf.copy(cascadeProto, 2); proto1[0] = 0x08;
r = await tryProtoRPC('StreamAgentStateUpdates', cascadeProto); proto1[1] = 0x01; // field1 varint = 1
console.log(`Gravity Bridge: [Trial D2] AgentState(${gid.substring(0, 8)}): ${r.substring(0, 600)}`); proto1[2] = 0x12;
// Also try GetCascadeTrajectorySteps with proto encoding proto1[3] = gidBuf.length; // field2 string
// field 1 = trajectoryId (string), field 2 = startStepIndex (varint) gidBuf.copy(proto1, 4);
let r = await tryProtoRPC('StreamCascadeReactiveUpdates', proto1);
console.log(`Gravity Bridge: [Trial D3] StreamCascade(v1+cascade): ${r.substring(0, 800)}`);
// Attempt 2: field1=cascadeId(string), field2=version(varint=1)
// 0x0A <len> <cascadeId> 0x10 0x01
const proto2 = Buffer.alloc(2 + gidBuf.length + 2);
proto2[0] = 0x0A;
proto2[1] = gidBuf.length; // field1 string
gidBuf.copy(proto2, 2);
proto2[2 + gidBuf.length] = 0x10; // field2 varint
proto2[3 + gidBuf.length] = 0x01;
r = await tryProtoRPC('StreamCascadeReactiveUpdates', proto2);
console.log(`Gravity Bridge: [Trial D3] StreamCascade(cascade+v1): ${r.substring(0, 800)}`);
// Attempt 3: StreamCascadeSummariesReactiveUpdates with version+cascadeId
r = await tryProtoRPC('StreamCascadeSummariesReactiveUpdates', proto1);
console.log(`Gravity Bridge: [Trial D3] StreamSummaries(v1+cascade): ${r.substring(0, 800)}`);
// Attempt 4: GetCascadeTrajectorySteps with proto
const stepIdx = Math.max(0, latest.lastStepIndex - 1); const stepIdx = Math.max(0, latest.lastStepIndex - 1);
const stepsProto = Buffer.alloc(2 + gidBuf.length + 2); const stepsProto = Buffer.alloc(2 + gidBuf.length + 2);
stepsProto[0] = 0x0A; stepsProto[0] = 0x0A;
stepsProto[1] = gidBuf.length; stepsProto[1] = gidBuf.length;
gidBuf.copy(stepsProto, 2); gidBuf.copy(stepsProto, 2);
stepsProto[2 + gidBuf.length] = 0x10; // field 2 varint stepsProto[2 + gidBuf.length] = 0x10;
stepsProto[3 + gidBuf.length] = stepIdx; stepsProto[3 + gidBuf.length] = stepIdx;
r = await tryProtoRPC('GetCascadeTrajectorySteps', stepsProto); r = await tryProtoRPC('GetCascadeTrajectorySteps', stepsProto);
console.log(`Gravity Bridge: [Trial D2] Steps(proto): ${r.substring(0, 800)}`); console.log(`Gravity Bridge: [Trial D3] Steps(proto): ${r.substring(0, 1000)}`);
} }
} }
catch (e) { catch (e) {
console.log(`Gravity Bridge: [Trial D2] err: ${e.message}`); console.log(`Gravity Bridge: [Trial D3] err: ${e.message}`);
} }
}, 15000); }, 15000);
// Start LS bridge after a delay // Start LS bridge after a delay

File diff suppressed because one or more lines are too long

View File

@@ -469,18 +469,7 @@ export function activate(context: vscode.ExtensionContext) {
}); });
} }
// protobuf: field 1 (protocol_version) = 1 → 0x08 0x01 // Get latest trajectory ID first, then try streams WITH cascadeId
const versionOnly = Buffer.from([0x08, 0x01]);
// Try StreamCascadeReactiveUpdates with version=1
let r = await tryProtoRPC('StreamCascadeReactiveUpdates', versionOnly);
console.log(`Gravity Bridge: [Trial D2] StreamCascade(v1): ${r.substring(0, 600)}`);
// Try StreamCascadeSummariesReactiveUpdates with version=1
r = await tryProtoRPC('StreamCascadeSummariesReactiveUpdates', versionOnly);
console.log(`Gravity Bridge: [Trial D2] StreamSummaries(v1): ${r.substring(0, 600)}`);
// Get latest trajectory ID and try StreamAgentStateUpdates with cascadeId
try { try {
const dRaw = await vscode.commands.executeCommand('antigravity.getDiagnostics'); const dRaw = await vscode.commands.executeCommand('antigravity.getDiagnostics');
const d = typeof dRaw === 'string' ? JSON.parse(dRaw) : dRaw; const d = typeof dRaw === 'string' ? JSON.parse(dRaw) : dRaw;
@@ -488,33 +477,46 @@ export function activate(context: vscode.ExtensionContext) {
if (ts.length > 0) { if (ts.length > 0) {
const latest = ts[ts.length - 1]; const latest = ts[ts.length - 1];
const gid = latest.googleAgentId || ''; const gid = latest.googleAgentId || '';
console.log(`Gravity Bridge: [Trial D2] Using trajectory ${gid.substring(0, 8)}`); console.log(`Gravity Bridge: [Trial D3] Using cascade ${gid.substring(0, 8)} step=${latest.lastStepIndex}`);
// Build protobuf with cascadeId string: field 1 = gid
// string field: tag=0x0A (field 1 wire type 2), length, bytes
const gidBuf = Buffer.from(gid, 'utf-8'); const gidBuf = Buffer.from(gid, 'utf-8');
const cascadeProto = Buffer.alloc(2 + gidBuf.length);
cascadeProto[0] = 0x0A; // field 1, wire type 2 (length-delimited)
cascadeProto[1] = gidBuf.length;
gidBuf.copy(cascadeProto, 2);
r = await tryProtoRPC('StreamAgentStateUpdates', cascadeProto); // Attempt 1: field1=version(varint=1), field2=cascadeId(string)
console.log(`Gravity Bridge: [Trial D2] AgentState(${gid.substring(0, 8)}): ${r.substring(0, 600)}`); // 0x08 0x01 0x12 <len> <cascadeId>
const proto1 = Buffer.alloc(2 + 2 + gidBuf.length);
proto1[0] = 0x08; proto1[1] = 0x01; // field1 varint = 1
proto1[2] = 0x12; proto1[3] = gidBuf.length; // field2 string
gidBuf.copy(proto1, 4);
// Also try GetCascadeTrajectorySteps with proto encoding let r = await tryProtoRPC('StreamCascadeReactiveUpdates', proto1);
// field 1 = trajectoryId (string), field 2 = startStepIndex (varint) console.log(`Gravity Bridge: [Trial D3] StreamCascade(v1+cascade): ${r.substring(0, 800)}`);
// Attempt 2: field1=cascadeId(string), field2=version(varint=1)
// 0x0A <len> <cascadeId> 0x10 0x01
const proto2 = Buffer.alloc(2 + gidBuf.length + 2);
proto2[0] = 0x0A; proto2[1] = gidBuf.length; // field1 string
gidBuf.copy(proto2, 2);
proto2[2 + gidBuf.length] = 0x10; // field2 varint
proto2[3 + gidBuf.length] = 0x01;
r = await tryProtoRPC('StreamCascadeReactiveUpdates', proto2);
console.log(`Gravity Bridge: [Trial D3] StreamCascade(cascade+v1): ${r.substring(0, 800)}`);
// Attempt 3: StreamCascadeSummariesReactiveUpdates with version+cascadeId
r = await tryProtoRPC('StreamCascadeSummariesReactiveUpdates', proto1);
console.log(`Gravity Bridge: [Trial D3] StreamSummaries(v1+cascade): ${r.substring(0, 800)}`);
// Attempt 4: GetCascadeTrajectorySteps with proto
const stepIdx = Math.max(0, latest.lastStepIndex - 1); const stepIdx = Math.max(0, latest.lastStepIndex - 1);
const stepsProto = Buffer.alloc(2 + gidBuf.length + 2); const stepsProto = Buffer.alloc(2 + gidBuf.length + 2);
stepsProto[0] = 0x0A; stepsProto[0] = 0x0A; stepsProto[1] = gidBuf.length;
stepsProto[1] = gidBuf.length;
gidBuf.copy(stepsProto, 2); gidBuf.copy(stepsProto, 2);
stepsProto[2 + gidBuf.length] = 0x10; // field 2 varint stepsProto[2 + gidBuf.length] = 0x10;
stepsProto[3 + gidBuf.length] = stepIdx; stepsProto[3 + gidBuf.length] = stepIdx;
r = await tryProtoRPC('GetCascadeTrajectorySteps', stepsProto); r = await tryProtoRPC('GetCascadeTrajectorySteps', stepsProto);
console.log(`Gravity Bridge: [Trial D2] Steps(proto): ${r.substring(0, 800)}`); console.log(`Gravity Bridge: [Trial D3] Steps(proto): ${r.substring(0, 1000)}`);
} }
} catch (e: any) { console.log(`Gravity Bridge: [Trial D2] err: ${e.message}`); } } catch (e: any) { console.log(`Gravity Bridge: [Trial D3] err: ${e.message}`); }
}, 15000); }, 15000);