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
8 changes: 0 additions & 8 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ on:
- "apps/**/*.vue"
- "docker/**"
- "packages/**"
- "packages/**/*.js"
- "packages/**/*.ts"
- "packages/**/*.tsx"
- "packages/**/*.vue"
- "scripts/**/*.mjs"
- "package.json"
- "pnpm-lock.yaml"
Expand All @@ -44,10 +40,6 @@ on:
- "apps/**/*.vue"
- "docker/**"
- "packages/**"
- "packages/**/*.js"
- "packages/**/*.ts"
- "packages/**/*.tsx"
- "packages/**/*.vue"
- "scripts/**/*.mjs"
- "package.json"
- "pnpm-lock.yaml"
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,14 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.10.1
only-new-issues: true
version: v2.15.0

test:
name: Test
Expand Down Expand Up @@ -209,7 +207,7 @@ jobs:
TEST_POSTGRES_BOOTSTRAP_SCHEMA=0 go test -v -race -count=1 -timeout 90s \
./internal/agent/runtime/session/ledger
TEST_POSTGRES_BOOTSTRAP_SCHEMA=0 go test -v -race -count=1 -timeout 90s \
-run '^TestPostgres(ResumeScopes|ShutdownResume|WSStepHistory|ProviderUsage|RedisDecision|NativeDecisionAcceptance|HistoryReset|RedisHistoryReset)' ./internal/agent/application
-run '^TestPostgres(ResumeScopes|ShutdownResume|WSStepHistory|ProviderUsage|NativeDecisionAcceptance|HistoryReset|RedisHistoryReset)' ./internal/agent/application
TEST_POSTGRES_BOOTSTRAP_SCHEMA=0 go test -v -race -count=1 -timeout 90s \
-run '^TestPostgresBotCreate' ./internal/bots
TEST_POSTGRES_BOOTSTRAP_SCHEMA=0 go test -v -race -count=1 -timeout 90s \
Expand Down
6 changes: 0 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: "2"

run:
timeout: 15m
go: "1.25"
tests: true

output:
Expand Down Expand Up @@ -72,11 +71,6 @@ linters:
disable:
- shadow
- fieldalignment
gocyclo:
min-complexity: 10
funlen:
lines: 60
statements: 30
perfsprint:
int-conversion: true
err-error: true
Expand Down
13 changes: 12 additions & 1 deletion .husky/checks.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { spawn, spawnSync } from 'node:child_process'
import { realpathSync } from 'node:fs'
import { dirname, extname } from 'node:path'
import { fileURLToPath } from 'node:url'

Expand Down Expand Up @@ -169,6 +170,16 @@ async function main() {
console.log(`[hooks] Total: ${((performance.now() - started) / 1000).toFixed(2)}s`)
}

if (process.argv[1] === fileURLToPath(import.meta.url)) {
// Node reports this module by its real path, while argv[1] is the path the
// caller used. Compare real paths, or a checkout reached through a symlink
// (macOS /tmp, a linked worktree directory) imports the module, runs nothing
// and exits 0.
function isEntryPoint() {
if (!process.argv[1]) return false
try { return realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url)) }
catch { return false }
}

if (isEntryPoint()) {
main().catch(error => { console.error(`[hooks] ${error.message}`); process.exitCode = 1 })
}
2 changes: 1 addition & 1 deletion cmd/bridge/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func superviseXvnc(ctx context.Context, log *slog.Logger) {
select {
case <-ctx.Done():
_ = cmd.Process.Kill()
<-waitErr
<-waitErr //nolint:errcheck // reaps Xvnc; the wait error is the kill above.
return
case err := <-waitErr:
if ctx.Err() != nil {
Expand Down
2 changes: 1 addition & 1 deletion devenv/Dockerfile.server
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Dev server image: Go + containerd + CNI. Workspace tools come exclusively
# from the image built by docker/Dockerfile.workspace.

FROM golang:1.26.10-alpine
FROM golang:1.27.4-alpine

WORKDIR /workspace

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.server
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
FROM scratch AS gomodcache

# ---- Stage 1: Build base with dependencies ----
FROM --platform=$BUILDPLATFORM golang:1.26.10-alpine AS build-base
FROM --platform=$BUILDPLATFORM golang:1.27.4-alpine AS build-base
WORKDIR /build
RUN apk add --no-cache git make
COPY go.mod go.sum ./
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.workspace
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN chmod 0755 /opt/memoh/toolkit/display/bin/a11y-cli
# Only the live ACP integration-test target needs a bridge baked into the
# image. Production workspace containers receive the current bridge from the
# Server as a read-only file mount.
FROM --platform=$BUILDPLATFORM golang:1.26.10-alpine AS bridge-builder
FROM --platform=$BUILDPLATFORM golang:1.27.4-alpine AS bridge-builder
ARG TARGETARCH
WORKDIR /build
RUN apk add --no-cache git
Expand Down
8 changes: 5 additions & 3 deletions docs/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,11 @@ one, is answered with the field it names:

`field` is the name the request uses: the JSON key, query parameter or path
parameter as written there, without changing its case, with dots for a nested
key. It is written as a string literal where the field is read; a guard test
in `internal/apperror` fails on any other argument. A response names one
field: a handler returns at the first problem.
key. A value inside an array is named with its position and a map value with
its key (`items.1.count`, `meta.k.count`). It is written as a string literal
where the field is read; a guard test in `internal/apperror` fails on any
other argument. A response names one field: a handler returns at the first
problem.

Both HTTP servers bind with `httpx.Binder`, so a JSON value of the wrong type
is answered as `request.field_invalid` for its key. Malformed JSON has no
Expand Down
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export default [
'apps/web/src/components/sidebar/files-pane.vue',
'apps/web/src/pages/home/components/attachment-block.vue',
'apps/web/src/pages/home/components/browser-pane.vue',
'apps/web/src/pages/home/components/dockview/panel-asset.vue',
],
rules: {
'no-restricted-globals': [
Expand Down
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/felinics/memoh

go 1.26.10
go 1.27.4

require (
github.com/BurntSushi/toml v1.6.0
Expand Down
8 changes: 6 additions & 2 deletions internal/agent/application/service_direct_lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ func TestDirectChatWithoutCallerDeadlineUsesBoundedNonStreamingClient(t *testing
case <-fixture.started:
case <-time.After(time.Second):
cancel()
<-done
if err := <-done; err != nil {
t.Logf("Chat() after cancel: %v", err)
}
t.Fatal("provider did not receive synchronous Chat request")
}

Expand All @@ -349,7 +351,9 @@ func TestDirectChatWithoutCallerDeadlineUsesBoundedNonStreamingClient(t *testing
}
case <-time.After(500 * time.Millisecond):
cancel()
<-done
if err := <-done; err != nil {
t.Logf("Chat() after cancel: %v", err)
}
t.Fatal("Chat() remained blocked after the bounded response-header window")
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/agent/application/service_run_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func (s *Service) reconcileTerminalContextLifecycle(ctx context.Context, run ses
replaceSnapshot = true
case existingReady:
snapshot = append([]byte(nil), existing.Snapshot...)
case !existingReady:
default:
recovered, ready, recoverErr := s.assistantContextLifecycleSnapshot(writeCtx, runUUID)
if recoverErr != nil {
s.recordContextLifecyclePersistenceError(recoverErr, run.RunID, run.BotID, run.SessionID, status)
Expand Down
4 changes: 3 additions & 1 deletion internal/agent/application/service_runtime_controls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ type controlQueries struct {
stale bool
}

func (*controlQueries) SupportsTransactions() bool { return true }
func (*controlQueries) SupportsTransactions() bool { return true }

func (q *controlQueries) InTx(_ context.Context, fn func(dbstore.Queries) error) error { return fn(q) }

func (*controlQueries) LockBotForSessionWrite(_ context.Context, id pgtype.UUID) (pgtype.UUID, error) {
return id, nil
}
Expand Down
4 changes: 3 additions & 1 deletion internal/agent/application/service_trigger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ func TestTriggeredNativeStreamCallerCancellationWinsOverIdleTimeout(t *testing.T
case <-provider.started:
case <-time.After(time.Second):
cancel(wantCause)
<-done
if err := <-done; err != nil {
t.Logf("run after cancel: %v", err)
}
t.Fatal("silent provider was not started")
}
cancel(wantCause)
Expand Down
4 changes: 3 additions & 1 deletion internal/agent/context/compaction/service_activity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ func TestCompactionActivityLifecycle(t *testing.T) {
ids := svc.ActiveSessions(cfg.BotID)
other := svc.ActiveSessions("other-bot")
close(release)
<-done
if err := <-done; err != nil {
t.Logf("Compact: %v", err)
}
if len(ids) != 1 || ids[0] != cfg.SessionID || len(other) != 0 {
t.Fatalf("incorrect active sessions: %v, other bot: %v", ids, other)
}
Expand Down
6 changes: 6 additions & 0 deletions internal/agent/toolexec/define_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ func TestTypedReportsDecodeErrorsByProperty(t *testing.T) {
if err == nil || err.Error() != "invalid arguments for probe: name must be a string, got object" {
t.Fatalf("error = %v", err)
}
// A value inside an array is named with its position, so the model can
// tell which element to fix.
_, err = execute(&ToolExecContext{ToolName: "probe"}, sdk.ParseToolArguments(`{"ids": [1, 2, {"x": 1}]}`))
if err == nil || err.Error() != "invalid arguments for probe: ids.2 must be an integer, got object" {
t.Fatalf("array element error = %v", err)
}
// A nil context must not panic; the tool name falls back.
_, err = execute(nil, sdk.ParseToolArguments(`[1]`))
if err == nil || err.Error() != "invalid arguments for tool: arguments must be an object, got array" {
Expand Down
5 changes: 3 additions & 2 deletions internal/agent/view/uimessage_background.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ func ApplyBackgroundTaskSnapshots(turns []UITurn, tasks []UIBackgroundTask) {
if turns[turnIdx].Role != "assistant" {
continue
}
for messageIdx := range turns[turnIdx].Messages {
message := &turns[turnIdx].Messages[messageIdx]
messages := turns[turnIdx].Messages
for messageIdx := range messages {
message := &messages[messageIdx]
if message.Type != UIMessageTool || message.Background == nil {
continue
}
Expand Down
10 changes: 6 additions & 4 deletions internal/agent/view/uimessage_decisions.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ func ApplyToolApprovals(turns []UITurn, approvals []toolapproval.Request, canApp
if turns[turnIdx].Role != "assistant" {
continue
}
for msgIdx := range turns[turnIdx].Messages {
msg := &turns[turnIdx].Messages[msgIdx]
messages := turns[turnIdx].Messages
for msgIdx := range messages {
msg := &messages[msgIdx]
if msg.Type != UIMessageTool {
continue
}
Expand Down Expand Up @@ -85,8 +86,9 @@ func ApplyUserInputs(turns []UITurn, requests []userinput.Request, canRespondFn
if turns[turnIdx].Role != "assistant" {
continue
}
for msgIdx := range turns[turnIdx].Messages {
msg := &turns[turnIdx].Messages[msgIdx]
messages := turns[turnIdx].Messages
for msgIdx := range messages {
msg := &messages[msgIdx]
if msg.Type != UIMessageTool {
continue
}
Expand Down
5 changes: 4 additions & 1 deletion internal/agentcredential/authorization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ func (q *authorizationQueries) InTx(_ context.Context, fn func(dbstore.Queries)
defer q.mu.Unlock()
return fn(q)
}

func (*authorizationQueries) LockAgentAuthorizationOwner(context.Context, string) error { return nil }
func (*authorizationQueries) PruneAgentAuthorizations(context.Context) error { return nil }

func (*authorizationQueries) PruneAgentAuthorizations(context.Context) error { return nil }

func (*authorizationQueries) CountAgentAuthorizations(context.Context, pgtype.UUID) (int64, error) {
return 0, nil
}
Expand Down
Loading
Loading