fix: correct RPC method names from LS binary (Heartbeat, GetUserTrajectoryDescriptions, GetCascadeTrajectorySteps)

This commit is contained in:
2026-03-07 19:00:11 +09:00
parent f2ed431aa5
commit be6fae71de
4 changed files with 25 additions and 11 deletions

View File

@@ -187,7 +187,7 @@ export function activate(context: vscode.ExtensionContext) {
const req = proto.request({
hostname: '127.0.0.1',
port,
path: '/exa.language_server_pb.LanguageServerService/GetTrajectoryDescriptions',
path: '/exa.language_server_pb.LanguageServerService/Heartbeat',
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -267,15 +267,16 @@ export function activate(context: vscode.ExtensionContext) {
if (!lsPort) { return; }
try {
// Get trajectory descriptions — lightweight list of all conversations
const result = await lsRPC('GetTrajectoryDescriptions');
const result = await lsRPC('GetUserTrajectoryDescriptions');
if (!result) { return; }
// Debug: log structure on first call
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; }
for (const traj of trajectories) {
@@ -286,10 +287,16 @@ export function activate(context: vscode.ExtensionContext) {
if (prev !== undefined && stepIdx > prev) {
// New steps! Fetch full trajectory to get AI response
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,
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) {
extractAndRelay(full, prev, stepIdx);