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
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1885,6 +1885,15 @@ below row metadata and in the detail footer. **PURSUING GOAL**, **GOAL STALLED**
**GOAL PAUSED**, **GOAL USAGE LIMITED**, **GOAL BUDGET LIMITED** and **GOAL COMPLETE**
come from Codex—not inactivity guesses—and do not replace WORKING, approvals or
TURN COMPLETE. Unavailable refreshes mark retained observations **GOAL STALE**.
Terminal goal labels include Codex's reported pursuit duration when it fits,
for example `PURSUING GOAL // 1d 1h 23m`. Zero units are omitted; less than a
minute is shown as `<1m`. The duration is omitted before crowding other footer
controls, and stale observations do not show a duration. This is accumulated
wall-clock pursuit time recorded by Codex (including tool execution), not time
since the goal was created or a model-only thinking timer. It updates when Codex
reports accounting progress, not on a locally invented ticking clock. Codex
retains its goal accounting across Codexometer restarts; replacing the goal
resets it.
Use `/goal` for the objective and counters. Linked agents do not inherit their
parent’s goal label, and goal observations are not persisted by Codexometer.
The menu shows one compact overview: **Create goal** when empty, or **Edit
Expand Down Expand Up @@ -3853,11 +3862,12 @@ go test -race -cover -timeout 10m -skip '^TestLocalisedScreens$' ./...
go test -race -cover -timeout 10m -run '^TestLocalisedScreens$' ./internal/ui
```

An optional Unix integration check verifies the installed Codex against either
the 0.164.0 baseline, 0.166.0 or 0.167.0, including negotiated compressed WebSocket RPC:
An optional Unix integration check verifies the installed Codex against the
0.164.0 baseline, 0.166.0, 0.167.0, 0.167.1 or 0.167.2, including negotiated
compressed WebSocket RPC:

```sh
CODEXOMETER_TEST_CODEX_VERSION=0.167.0 go test ./internal/codex -run '^TestNativeCodexCompression$' -count=1
CODEXOMETER_TEST_CODEX_VERSION=0.167.2 go test ./internal/codex -run '^TestNativeCodexCompression$' -count=1
```

Use `0.164.0` when that version is on `PATH`; the existing
Expand All @@ -3875,7 +3885,7 @@ virtual clock rather than depending on millisecond wall-clock scheduling.

Codexometer uses:

- Go 1.27.3+
- Go 1.27.4+
- Bubble Tea v2 for the terminal event loop and declarative terminal modes
- Lip Gloss v2 for adaptive ANSI styling and layout
- Starlark for deterministic, hermetic benchmark-code evaluation
Expand Down
Binary file modified assets/screenshots/approval.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshots/benchmark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions assets/screenshots/manifest.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified assets/screenshots/pace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshots/quota.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshots/scheduler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshots/sessions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshots/usage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/merefield/codexometer

go 1.27.3
go 1.27.4

require (
charm.land/bubbles/v2 v2.2.1
Expand Down
8 changes: 5 additions & 3 deletions internal/codex/daemon_native_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"os/exec"
"path/filepath"
"slices"
"strings"
"testing"
"time"
Expand All @@ -19,11 +20,12 @@ func TestNativeCodexCompression(t *testing.T) {
if expected == "" && os.Getenv("CODEXOMETER_TEST_CODEX_164") == "1" {
expected = "0.164.0" // Retain the existing baseline test invocation.
}
versions := []string{"0.164.0", "0.166.0", "0.167.0", "0.167.1", "0.167.2"}
if expected == "" {
t.Skip("set CODEXOMETER_TEST_CODEX_VERSION=0.164.0, 0.166.0 or 0.167.0 with that Codex installed")
t.Skip("set CODEXOMETER_TEST_CODEX_VERSION to one of " + strings.Join(versions, ", ") + " with that Codex installed")
}
if expected != "0.164.0" && expected != "0.166.0" && expected != "0.167.0" {
t.Fatal("native compatibility target must be 0.164.0, 0.166.0 or 0.167.0")
if !slices.Contains(versions, expected) {
t.Fatal("native compatibility target must be one of " + strings.Join(versions, ", "))
}
binary, err := exec.LookPath("codex")
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/ui/documentation_screenshots_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func documentationScenes(version string) []documentationScene {
sessions.monitorSessionData[0].working = true
sessions.monitorSessionData[0].agentCount = 2
sessions.monitorSessionData[0].modelSettings.ServiceTier = "fast"
sessions.monitorSessionData[0].goal = &codex.SessionGoal{Status: "active", Objective: "Build a beautiful, responsive dashboard", TokensUsed: 168_400, TokenBudget: &budget}
sessions.monitorSessionData[0].goal = &codex.SessionGoal{Status: "active", Objective: "Build a beautiful, responsive dashboard", TokensUsed: 168_400, TokenBudget: &budget, TimeUsedSeconds: 4980}
sessions.monitorSessionData[0].preview.Kind = codex.SessionContextActivity
sessions.monitorSessionData[0].preview.Text = "The layout is responsive. I’m checking the narrow-terminal behaviour next."
sessions.monitorSessionData[0].preview.CurrentTask = "Give the dashboard a little more rocket fuel."
Expand Down
2 changes: 1 addition & 1 deletion internal/ui/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func (m Model) renderMonitorSessionMetrics(width, height int, session monitorSes
lines = append(lines, colors.label().Bold(true).Render(ansi.Truncate(field, innerWidth, "…")))
}
}
if goal := m.monitorGoalStatus(session, colors); goal != "" && len(lines) < bodyRows {
if goal := m.monitorGoalStatus(session, innerWidth, colors); goal != "" && len(lines) < bodyRows {
lines = append(lines, ansi.Truncate(goal, innerWidth, "…"))
}
appendPriority := func(value string) {
Expand Down
49 changes: 39 additions & 10 deletions internal/ui/monitor_goal.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
package ui

import (
"fmt"
"strings"

"github.com/charmbracelet/x/ansi"
"github.com/merefield/codexometer/internal/i18n"
)

func (m Model) monitorGoalStatus(s monitorSession, colors palette) string {
// Work in seconds rather than time.Duration so long-lived counters cannot
// overflow. This is Codex's reported pursuit time, not time since creation.
func formatGoalDuration(seconds int64) string {
if seconds < 60 {
return "<1m"
}
parts := make([]string, 0, 3)
for _, unit := range []struct {
seconds int64
suffix string
}{{86400, "d"}, {3600, "h"}, {60, "m"}} {
if count := seconds / unit.seconds; count > 0 {
parts = append(parts, fmt.Sprintf("%d%s", count, unit.suffix))
}
seconds %= unit.seconds
}
return strings.Join(parts, " ")
}

func (m Model) monitorGoalStatus(s monitorSession, width int, colors palette) string {
goal := s.goal.Clone()
if goal == nil {
return ""
Expand All @@ -26,7 +46,14 @@ func (m Model) monitorGoalStatus(s monitorSession, colors palette) string {
style = style.Foreground(colors.warning)
}
}
return style.Render(i18n.Text(goal.Label()))
label := i18n.Text(goal.Label())
if !goal.Stale {
withDuration := label + " // " + formatGoalDuration(goal.TimeUsedSeconds)
if ansi.StringWidth(withDuration) <= width {
label = withDuration
}
}
return style.Render(label)
}

// Keep existing buttons anchored at the far right. Goal status is display-only
Expand All @@ -36,18 +63,20 @@ func (m Model) monitorGoalFooter(width int, controls string, colors palette) str
if !ok || m.hasSessionProfile(s) {
return controls
}
goal := m.monitorGoalStatus(s, colors)
if goal == "" {
available := width - 6
if controls != "" {
available -= ansi.StringWidth(controls) + 2
}
if m.monitorStatusLineText(width, controls) != "" {
available -= 12
}
goal := m.monitorGoalStatus(s, available, colors)
if goal == "" || ansi.StringWidth(goal) > available {
return controls
}
parts := []string{goal}
if controls != "" {
parts = append(parts, controls)
}
footer := strings.Join(parts, " ")
spare := width - ansi.StringWidth(footer) - 6
if spare < 0 || spare < 12 && m.monitorStatusLineText(width, controls) != "" {
return controls
}
return footer
return strings.Join(parts, " ")
}
Loading
Loading