Skip to content

Commit 9b1b67e

Browse files
committed
(human) more bug fixes and print removals
1 parent ff24222 commit 9b1b67e

File tree

6 files changed

+33
-7
lines changed

6 files changed

+33
-7
lines changed

lib/agent/agents/cue.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ func buildTools(cfg *config.Config, agt config.Agent, models map[string]model.LL
267267
ts = append(ts, T)
268268
}
269269

270-
fmt.Println("Final Tools:", ts)
270+
// fmt.Println("Final Tools:", ts)
271271
return ts, nil
272272
}
273273

@@ -407,7 +407,7 @@ func RenderInstructionsWithNameAndState(cfg *config.Config, agt config.Agent, na
407407
return "", err
408408
}
409409

410-
debugPrintData(data)
410+
// debugPrintData(data)
411411

412412
// render instruction (first time) to get length
413413
b, err := t.Render(data)

lib/agent/cmd/runtime.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,12 @@ func extractMeta(a *agent.Agentic) (aname, akind, mname string) {
245245
if aname == "" {
246246
aname = mname
247247
}
248-
aname, _ = strconv.Unquote(aname)
249-
mname, _ = strconv.Unquote(mname)
248+
if strings.HasPrefix(aname, "\"") && strings.HasSuffix(aname, "\"") {
249+
aname, _ = strconv.Unquote(aname)
250+
}
251+
if strings.HasPrefix(mname, "\"") && strings.HasSuffix(mname, "\"") {
252+
mname, _ = strconv.Unquote(mname)
253+
}
250254
return aname, akind, mname
251255
}
252256

lib/agent/cmd/tui/chat.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ func (m *chatModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
117117
// m.root.msg = msg.String()
118118
switch {
119119
case key.Matches(msg, m.keymap.info):
120-
m.root.updateCurrName("info")
120+
if !m.textarea.Focused() {
121+
m.root.updateCurrName("info")
122+
}
121123

122124
case key.Matches(msg, m.keymap.back):
123125
if m.textarea.Focused() {
@@ -130,8 +132,8 @@ func (m *chatModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
130132
if m.textarea.Focused() {
131133
// TODO, actually send the message
132134
content := m.textarea.Value()
133-
// lines := strings.Split(content, "\n")
134-
// m.root.msg = lines[0]
135+
lines := strings.Split(content, "\n")
136+
m.root.msg = lines[0]
135137
m.root.sendMessage(content)
136138

137139
if m.root.asession != nil {

lib/agent/cmd/tui/root.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ func (m *Model) sendMessage(text string) error {
360360
Sid: m.currSid,
361361
Agent: "veggie",
362362
Model: "gemini-3-flash",
363+
Text: text,
363364
}
364365
s, err := common.SessionChat(m.R, m.AR, p)
365366
if err != nil {

lib/agent/runtime/runtime.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ func (r *Runtime) initServer() error {
256256
func (r *Runtime) BackfillAgentic() error {
257257
cfg := agentconfig.NewConfig()
258258

259+
// fmt.Println("Agentics", len(r.Agentics))
259260
for _, a := range r.Agentics {
260261
switch a.Hof.Agentic.Kind {
261262
case "agent":
@@ -293,6 +294,8 @@ func (r *Runtime) BackfillAgentic() error {
293294

294295
r.Agentic = cfg
295296

297+
// fmt.Printf("%#+v\n", pretty.Formatter(cfg))
298+
296299
return nil
297300
}
298301

lib/extension/cmd.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55

66
"github.com/hofstadter-io/hof/cmd/hof/flags"
7+
"github.com/hofstadter-io/hof/lib/agent"
78
aruntime "github.com/hofstadter-io/hof/lib/agent/runtime"
89
"github.com/hofstadter-io/hof/lib/agent/runtime/handlers/ws"
910
"github.com/hofstadter-io/hof/lib/cuetils"
@@ -22,11 +23,18 @@ func Run(args []string, rflags flags.RootPflagpole) error {
2223
return cuetils.ExpandCueError(err)
2324
}
2425

26+
// fmt.Println("R.Agentics:", len(r.Agentics))
27+
2528
err = r.InitServices()
2629
if err != nil {
2730
return fmt.Errorf("failed to init services: %v", err)
2831
}
2932

33+
err = r.EnrichAgentic(nil, AgenticEnricher)
34+
if err != nil {
35+
return err
36+
}
37+
3038
ar, err := aruntime.NewRuntime(
3139
r.DB,
3240
r.Envs,
@@ -35,9 +43,17 @@ func Run(args []string, rflags flags.RootPflagpole) error {
3543
if err != nil {
3644
return fmt.Errorf("failed to create agent runtime: %v", err)
3745
}
46+
// fmt.Println("AR.Agentics:", len(ar.Agentics))
47+
3848
ar.BackfillAgentic()
3949

50+
// fmt.Println("BR.Agentics:", len(ar.Agentics))
4051
ws.SetupHandlers(ar)
4152

4253
return ar.Run()
4354
}
55+
56+
func AgenticEnricher(R *runtime.Runtime, e *agent.Agentic) error {
57+
// no-op for now
58+
return nil
59+
}

0 commit comments

Comments
 (0)