fix: correct RPC method names from LS binary (Heartbeat, GetUserTrajectoryDescriptions, GetCascadeTrajectorySteps)
This commit is contained in:
Binary file not shown.
@@ -199,7 +199,7 @@ function activate(context) {
|
|||||||
const req = proto.request({
|
const req = proto.request({
|
||||||
hostname: '127.0.0.1',
|
hostname: '127.0.0.1',
|
||||||
port,
|
port,
|
||||||
path: '/exa.language_server_pb.LanguageServerService/GetTrajectoryDescriptions',
|
path: '/exa.language_server_pb.LanguageServerService/Heartbeat',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@@ -287,15 +287,16 @@ function activate(context) {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// Get trajectory descriptions — lightweight list of all conversations
|
// Get trajectory descriptions — lightweight list of all conversations
|
||||||
const result = await lsRPC('GetTrajectoryDescriptions');
|
const result = await lsRPC('GetUserTrajectoryDescriptions');
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Debug: log structure on first call
|
// Debug: log structure on first call
|
||||||
if (Object.keys(lastStepIndex).length === 0) {
|
if (Object.keys(lastStepIndex).length === 0) {
|
||||||
console.log(`Gravity Bridge: [LS] trajectories: ${JSON.stringify(result).substring(0, 500)}`);
|
console.log(`Gravity Bridge: [LS] trajectories response keys: ${typeof result === 'object' ? Object.keys(result).join(', ') : typeof result}`);
|
||||||
|
console.log(`Gravity Bridge: [LS] trajectories sample: ${JSON.stringify(result).substring(0, 600)}`);
|
||||||
}
|
}
|
||||||
const trajectories = result.trajectories || result.trajectory_descriptions || [];
|
const trajectories = result.trajectories || result.trajectory_descriptions || result.userTrajectoryDescriptions || result.user_trajectory_descriptions || [];
|
||||||
if (!Array.isArray(trajectories)) {
|
if (!Array.isArray(trajectories)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -306,10 +307,16 @@ function activate(context) {
|
|||||||
if (prev !== undefined && stepIdx > prev) {
|
if (prev !== undefined && stepIdx > prev) {
|
||||||
// New steps! Fetch full trajectory to get AI response
|
// New steps! Fetch full trajectory to get AI response
|
||||||
console.log(`Gravity Bridge: [LS] ${id.substring(0, 8)} new steps: ${prev} → ${stepIdx}`);
|
console.log(`Gravity Bridge: [LS] ${id.substring(0, 8)} new steps: ${prev} → ${stepIdx}`);
|
||||||
const full = await lsRPC('GetCascadeTrajectory', {
|
const full = await lsRPC('GetCascadeTrajectorySteps', {
|
||||||
googleAgentId: id,
|
googleAgentId: id,
|
||||||
trajectoryId: traj.trajectoryId || traj.trajectory_id || '',
|
trajectoryId: traj.trajectoryId || traj.trajectory_id || '',
|
||||||
|
startStepIndex: prev,
|
||||||
});
|
});
|
||||||
|
// Also log structure on first fetch
|
||||||
|
if (full) {
|
||||||
|
console.log(`Gravity Bridge: [LS] steps response keys: ${typeof full === 'object' ? Object.keys(full).join(', ') : typeof full}`);
|
||||||
|
console.log(`Gravity Bridge: [LS] steps sample: ${JSON.stringify(full).substring(0, 600)}`);
|
||||||
|
}
|
||||||
if (full) {
|
if (full) {
|
||||||
extractAndRelay(full, prev, stepIdx);
|
extractAndRelay(full, prev, stepIdx);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -187,7 +187,7 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
const req = proto.request({
|
const req = proto.request({
|
||||||
hostname: '127.0.0.1',
|
hostname: '127.0.0.1',
|
||||||
port,
|
port,
|
||||||
path: '/exa.language_server_pb.LanguageServerService/GetTrajectoryDescriptions',
|
path: '/exa.language_server_pb.LanguageServerService/Heartbeat',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@@ -267,15 +267,16 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
if (!lsPort) { return; }
|
if (!lsPort) { return; }
|
||||||
try {
|
try {
|
||||||
// Get trajectory descriptions — lightweight list of all conversations
|
// Get trajectory descriptions — lightweight list of all conversations
|
||||||
const result = await lsRPC('GetTrajectoryDescriptions');
|
const result = await lsRPC('GetUserTrajectoryDescriptions');
|
||||||
if (!result) { return; }
|
if (!result) { return; }
|
||||||
|
|
||||||
// Debug: log structure on first call
|
// Debug: log structure on first call
|
||||||
if (Object.keys(lastStepIndex).length === 0) {
|
if (Object.keys(lastStepIndex).length === 0) {
|
||||||
console.log(`Gravity Bridge: [LS] trajectories: ${JSON.stringify(result).substring(0, 500)}`);
|
console.log(`Gravity Bridge: [LS] trajectories response keys: ${typeof result === 'object' ? Object.keys(result).join(', ') : typeof result}`);
|
||||||
|
console.log(`Gravity Bridge: [LS] trajectories sample: ${JSON.stringify(result).substring(0, 600)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const trajectories = result.trajectories || result.trajectory_descriptions || [];
|
const trajectories = result.trajectories || result.trajectory_descriptions || result.userTrajectoryDescriptions || result.user_trajectory_descriptions || [];
|
||||||
if (!Array.isArray(trajectories)) { return; }
|
if (!Array.isArray(trajectories)) { return; }
|
||||||
|
|
||||||
for (const traj of trajectories) {
|
for (const traj of trajectories) {
|
||||||
@@ -286,10 +287,16 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
if (prev !== undefined && stepIdx > prev) {
|
if (prev !== undefined && stepIdx > prev) {
|
||||||
// New steps! Fetch full trajectory to get AI response
|
// New steps! Fetch full trajectory to get AI response
|
||||||
console.log(`Gravity Bridge: [LS] ${id.substring(0, 8)} new steps: ${prev} → ${stepIdx}`);
|
console.log(`Gravity Bridge: [LS] ${id.substring(0, 8)} new steps: ${prev} → ${stepIdx}`);
|
||||||
const full = await lsRPC('GetCascadeTrajectory', {
|
const full = await lsRPC('GetCascadeTrajectorySteps', {
|
||||||
googleAgentId: id,
|
googleAgentId: id,
|
||||||
trajectoryId: traj.trajectoryId || traj.trajectory_id || '',
|
trajectoryId: traj.trajectoryId || traj.trajectory_id || '',
|
||||||
|
startStepIndex: prev,
|
||||||
});
|
});
|
||||||
|
// Also log structure on first fetch
|
||||||
|
if (full) {
|
||||||
|
console.log(`Gravity Bridge: [LS] steps response keys: ${typeof full === 'object' ? Object.keys(full).join(', ') : typeof full}`);
|
||||||
|
console.log(`Gravity Bridge: [LS] steps sample: ${JSON.stringify(full).substring(0, 600)}`);
|
||||||
|
}
|
||||||
|
|
||||||
if (full) {
|
if (full) {
|
||||||
extractAndRelay(full, prev, stepIdx);
|
extractAndRelay(full, prev, stepIdx);
|
||||||
|
|||||||
Reference in New Issue
Block a user