[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/store/RFC.md fully. Find features d... #76
3 changed files with 10 additions and 1 deletions
2
doc.go
2
doc.go
|
|
@ -89,7 +89,7 @@
|
|||
//
|
||||
// orphans := configuredStore.RecoverOrphans(".core/state")
|
||||
// for _, orphanWorkspace := range orphans {
|
||||
// fmt.Println(orphanWorkspace.Aggregate())
|
||||
// fmt.Println(orphanWorkspace.Name(), orphanWorkspace.Aggregate())
|
||||
// orphanWorkspace.Discard()
|
||||
// }
|
||||
//
|
||||
|
|
|
|||
|
|
@ -46,6 +46,14 @@ type Workspace struct {
|
|||
closed bool
|
||||
}
|
||||
|
||||
// Usage example: `workspaceName := workspace.Name(); fmt.Println(workspaceName)`
|
||||
func (workspace *Workspace) Name() string {
|
||||
if workspace == nil {
|
||||
return ""
|
||||
}
|
||||
return workspace.name
|
||||
}
|
||||
|
||||
func (workspace *Workspace) ensureReady(operation string) error {
|
||||
if workspace == nil {
|
||||
return core.E(operation, "workspace is nil", nil)
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ func TestWorkspace_RecoverOrphans_Good(t *testing.T) {
|
|||
|
||||
orphans := storeInstance.RecoverOrphans(stateDirectory)
|
||||
require.Len(t, orphans, 1)
|
||||
assert.Equal(t, "orphan-session", orphans[0].Name())
|
||||
assert.Equal(t, map[string]any{"like": 1}, orphans[0].Aggregate())
|
||||
|
||||
orphans[0].Discard()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue