Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions cmd/codeaf-replay/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,6 @@ var callSiteRoles = map[string]lane.Role{
// it sets lane.RoleStanding on its own context. The older tag stays so a
// log written before the change still reads.
"automation-check": lane.RoleStanding,
// internal/session/workstream_wake.go: one workstream's event turn sets
// lane.RoleStanding on its context; nobody is waiting on its stream.
"workstream-wake": lane.RoleStanding,
// internal/session/tools_doc.go: the model's own eyes on a document the
// `read` tool cannot open as text. A TOOL CALL INSIDE A TURN, so somebody IS
// waiting — the one of the three whose seconds are a person's.
Expand Down
13 changes: 0 additions & 13 deletions cmd/codeaf-replay/workstream_wake_fix2_test.go

This file was deleted.

9 changes: 2 additions & 7 deletions cmd/codeaf/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ func runApp(args []string) error {
// ONE SUPERVISOR FOR EVERY CONVERSATION THE APP BUILDS (appservices.go).
services := openAppServices()
appServiceDoor.Store(services)
appWorkstreamAgents.Store(backend)
appClientToolsBackend.Store(backend)
backend.attachServices(services)
guard.Go("app/crews-start", func() { backend.crews() })
Expand All @@ -215,7 +214,6 @@ func runApp(args []string) error {
defer keepAutomationsWindow("app")()
}
guard.Go("app/orders", func() { backend.watchOrders(backend.sweepStop) })
guard.Go("app/workstream-wakes", func() { backend.watchWorkstreamWakes(backend.sweepStop) })
// And what the last quit stopped in the middle of a reply carries on.
guard.Go("app/resume-after-quit", backend.resumeAfterQuit)
backend.startCloseWatch()
Expand Down Expand Up @@ -746,7 +744,7 @@ type appBackend struct {
collections *workspace.Store
collectionsClosed bool
collectionsPath string
workstreams appWorkstreams
collectionFactory collectionFactory
// services is the app's one supervisor of kept-running processes
// (appservices.go); nil is the capability absent.
services *appServices
Expand Down Expand Up @@ -2998,10 +2996,7 @@ func (b *appBackend) pump(a *appAgent, id string, live *appLive, turn uint64, n
if held {
live.box.Event(appwire.EventAgentChanged, appwire.AgentChanged{Agent: view})
}
b.spendMoved(func(spend appwire.Spend) {
b.moneyAfter(a, live, spend.TodayUSD)
b.workstreamAgentTurnSettled(id)
})
b.spendMoved(func(spend appwire.Spend) { b.moneyAfter(a, live, spend.TodayUSD) })
}

// ── entry ids ───────────────────────────────────────────────────────────────
Expand Down
28 changes: 4 additions & 24 deletions cmd/codeaf/appcollections.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"github.com/Agent-Field/codeaf/internal/home"
"github.com/Agent-Field/codeaf/internal/redact"
"github.com/Agent-Field/codeaf/internal/workspace"
"github.com/Agent-Field/codeaf/internal/workstream"
)

// appCollectionsPath is where the collections store is, the CLI's own default.
Expand Down Expand Up @@ -98,16 +97,11 @@ func (b *appBackend) closeCollections() {
// appCollectionError is a store refusal in the wire's codes.
func appCollectionError(err error) error {
var wire *appwire.Error
var taken *workspace.WorkstreamTaken
switch {
case err == nil:
return nil
case errors.As(err, &wire):
return wire
case errors.As(err, &taken):
return &appwire.Error{Code: appwire.CodeInOtherWorkstream, Message: taken.Error(), Detail: appwire.WorkstreamTaken{Factory: taken.Factory, Job: taken.Job, WorkstreamID: taken.WorkstreamID, WorkstreamName: taken.WorkstreamName}}
case errors.Is(err, workspace.ErrWorkstreamDelete):
return appwire.Errorf(appwire.CodeBadParams, "%s", err)
case errors.Is(err, workspace.ErrNameTaken):
return appwire.Errorf(appwire.CodeConflict, "%s", workspace.ErrNameTaken.Error())
case errors.Is(err, workspace.ErrCycle):
Expand Down Expand Up @@ -150,7 +144,7 @@ func appWireMember(m workspace.Member) appwire.Member {
}

func appWireCollection(s workspace.Summary) appwire.Collection {
return appwire.Collection{ID: s.ID, Name: s.Name, CreatedAt: appMoment(s.CreatedAt), Count: s.Count, LastAddedAt: appMoment(s.LastAddedAt), Holds: s.Holds, Workstream: s.Workstream}
return appwire.Collection{ID: s.ID, Name: s.Name, CreatedAt: appMoment(s.CreatedAt), Count: s.Count, LastAddedAt: appMoment(s.LastAddedAt), Holds: s.Holds}
}

// describe is one collection as the wire says it.
Expand Down Expand Up @@ -208,20 +202,10 @@ func (b *appBackend) RenameCollection(id, name string) (appwire.Collection, erro
if err != nil {
return appwire.Collection{}, err
}
before, err := s.Describe(context.Background(), id)
if err != nil {
return appwire.Collection{}, appCollectionError(err)
}
if before.Workstream && before.Name == name {
return appWireCollection(before), nil
}
if err := s.Rename(context.Background(), id, name); err != nil {
return appwire.Collection{}, appCollectionError(err)
}
b.collectionChanged(id, false)
if before.Workstream && before.Name != name {
b.workstreamCollectionChanged(id, workstream.PartWorkstream)
}
return describeCollection(s, id)
}

Expand Down Expand Up @@ -253,7 +237,6 @@ func (b *appBackend) DeleteCollection(id string) error {
b.collectionChanged(id, true)
for _, parent := range parents {
b.collectionChanged(parent, false)
b.workstreamCollectionChanged(parent, workstream.PartJobs)
}
return nil
}
Expand Down Expand Up @@ -285,7 +268,6 @@ func (b *appBackend) AddToCollection(id string, refs []appwire.Member) (appwire.
}
if len(added) > 0 {
b.collectionChanged(id, false)
b.workstreamCollectionChanged(id, workstream.PartJobs)
}
return out, nil
}
Expand All @@ -310,7 +292,6 @@ func (b *appBackend) RemoveFromCollection(id string, refs []appwire.Ref) (appwir
}
if len(removed) > 0 {
b.collectionChanged(id, false)
b.workstreamCollectionChanged(id, workstream.PartJobs)
}
return out, nil
}
Expand All @@ -327,7 +308,7 @@ func (b *appBackend) OpenCollection(id string, depth, limit int, after string) (
return appwire.CollectionOpenResult{}, appCollectionError(err)
}
r := newCollectionResolver(b)
r.prepareWorkstreamTree(tree.Level)
r.prepareFactoryTree(tree.Level)
var nodes func(level workspace.Level) []appwire.Node
nodes = func(level workspace.Level) []appwire.Node {
out := make([]appwire.Node, 0, len(level.Members))
Expand Down Expand Up @@ -379,7 +360,7 @@ func (b *appBackend) ExpandCollection(id string, depth, limit int) (appwire.Coll
Missing: e.Deleted, Unread: e.Unread, Collections: e.Collections, More: e.More,
}
r := newCollectionResolver(b)
r.prepareWorkstreamRefs(e.Refs)
r.prepareFactoryRefs(e.Refs)
for _, m := range e.Refs {
target := r.target(m.Ref)
switch target.State {
Expand Down Expand Up @@ -421,7 +402,6 @@ func (b *appBackend) RelinkCollection(id string, from, to appwire.Ref) (appwire.
// Relinking a member to itself changed nothing, so it says nothing.
if from != to {
b.collectionChanged(id, false)
b.workstreamCollectionChanged(id, workstream.PartJobs)
}
return appwire.CollectionRelinkResult{Member: appWireMember(m), Already: already}, nil
}
Expand Down Expand Up @@ -542,7 +522,7 @@ func (r *collectionResolver) target(ref workspace.Ref) appwire.Target {
switch ref.Kind {
case workspace.FactoryJobKind:
if _, ok := r.factoryTargets[ref]; !ok {
r.prepareWorkstreamRefs([]workspace.Member{{Ref: ref}})
r.prepareFactoryRefs([]workspace.Member{{Ref: ref}})
}
return r.factoryTargets[ref]
case workspace.ConversationKind:
Expand Down
Loading
Loading