Skip to content

Commit 29252de

Browse files
committed
fix: update vscdb tests for SyncAll context param
Made-with: Cursor
1 parent 6cc63e0 commit 29252de

8 files changed

Lines changed: 1726 additions & 8 deletions

File tree

cmd/agentsview/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ func runServe(args []string) {
194194
AgentDirs: cfg.AgentDirs,
195195
Machine: "local",
196196
BlockedResultCategories: cfg.ResultContentBlockedCategories,
197+
CursorStateDB: cfg.CursorStateDB,
197198
})
198199

199200
if database.NeedsResync() {

cmd/agentsview/sync.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ func runSync(args []string) {
9393
cleanResyncTemp(appCfg.DBPath)
9494

9595
engine := sync.NewEngine(database, sync.EngineConfig{
96-
AgentDirs: appCfg.AgentDirs,
97-
Machine: "local",
96+
AgentDirs: appCfg.AgentDirs,
97+
Machine: "local",
98+
CursorStateDB: appCfg.CursorStateDB,
9899
})
99100

100101
ctx := context.Background()

internal/config/config.go

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ type Config struct {
6767
RemoteAccess bool `json:"remote_access"`
6868
WriteTimeout time.Duration `json:"-"`
6969

70+
// CursorStateDB is the path to Cursor's global
71+
// state.vscdb SQLite database used as primary source
72+
// for tool calls and rich session metadata.
73+
// Set CURSOR_STATE_DB to override. Default:
74+
// ~/.config/Cursor/User/globalStorage/state.vscdb
75+
CursorStateDB string `json:"-"`
76+
7077
// AgentDirs maps each AgentType to its configured
7178
// directories. Single-dir agents store a one-element
7279
// slice; unconfigured agents use nil.
@@ -130,11 +137,15 @@ func Default() (Config, error) {
130137
}
131138

132139
return Config{
133-
Host: "127.0.0.1",
134-
Port: 8080,
135-
DataDir: dataDir,
136-
DBPath: filepath.Join(dataDir, "sessions.db"),
137-
WriteTimeout: 30 * time.Second,
140+
Host: "127.0.0.1",
141+
Port: 8080,
142+
DataDir: dataDir,
143+
DBPath: filepath.Join(dataDir, "sessions.db"),
144+
WriteTimeout: 30 * time.Second,
145+
CursorStateDB: filepath.Join(
146+
home,
147+
".config/Cursor/User/globalStorage/state.vscdb",
148+
),
138149
AgentDirs: agentDirs,
139150
agentDirSource: agentDirSource,
140151
WatchExcludePatterns: []string{".git", "node_modules", "__pycache__", ".venv", "venv", "vendor", ".next"},
@@ -322,6 +333,9 @@ func (c *Config) loadEnv() {
322333
if v := os.Getenv("AGENT_VIEWER_DATA_DIR"); v != "" {
323334
c.DataDir = v
324335
}
336+
if v := os.Getenv("CURSOR_STATE_DB"); v != "" {
337+
c.CursorStateDB = v
338+
}
325339
}
326340

327341
type stringListFlag []string

0 commit comments

Comments
 (0)