Skip to content

Commit 8c5c8fe

Browse files
committed
fix: sqlite error
1 parent e1c9cbb commit 8c5c8fe

5 files changed

Lines changed: 101 additions & 1 deletion

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
id: error-git-push-existing-creds
2+
category: error_recovery
3+
difficulty: hard
4+
name: Git push using stored credentials
5+
description: Agent fixes a file and needs to push to GitHub. The GitHub token is already saved in secrets. Agent must check secrets first instead of asking the user for credentials.
6+
expectedBehavior: >
7+
Agent should: (1) attempt git push, (2) when auth fails, immediately check stored secrets
8+
with secret_get for github/token, (3) configure git to use the token, (4) retry push.
9+
Must NOT ask user for credentials, must NOT try to login via browser/email,
10+
must NOT loop asking the same question multiple ways.
11+
messages:
12+
- text: "[env] ok: GITHUB_TOKEN\nError pushing to origin:\nremote: Permission denied to miybotagent\nfatal: unable to access 'https://github.com/cleanslice/runtime.git/': The requested URL returned error: 403\n\nЗалей исправление в репо"
13+
from: eval-user
14+
- text: "у тебя есть ключ"
15+
from: eval-user
16+
delayMs: 5000
17+
successCriteria:
18+
- dimension: tool_usage
19+
description: "Must call secret_get to retrieve stored GitHub token BEFORE asking user for credentials. Should not attempt browser login or email access."
20+
weight: 0.35
21+
- dimension: correctness
22+
description: "Configures git auth with the retrieved token and retries the push (or uses http_request to GitHub API as fallback)"
23+
weight: 0.30
24+
- dimension: error_handling
25+
description: "Does not loop or repeat failed approaches. If exec git push fails, tries secret_get immediately. Max 2-3 tool attempts before succeeding or giving a clear actionable error."
26+
weight: 0.20
27+
- dimension: soul_compliance
28+
description: "No filler, no action lists, no asking for things it can check itself. Acts first, reports after."
29+
weight: 0.15
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
id: multi-turn-fix-and-deploy
2+
category: multi_turn
3+
difficulty: hard
4+
name: Fix bug and push to repo
5+
description: >
6+
User reports a runtime error with stack trace. Agent must fix the code,
7+
commit, and push. When push fails with auth error, agent must use stored
8+
credentials (secret_get) instead of asking the user.
9+
expectedBehavior: >
10+
Turn 1: Agent reads the file from the stack trace, identifies the fix, applies it.
11+
Turn 2: Agent commits and pushes. If push fails with 403, agent checks secrets
12+
for github token, configures auth, retries. Does NOT ask user for credentials
13+
or try browser/email workarounds.
14+
messages:
15+
- text: "EACCES: permission denied, mkdir '/app/.agent/sessions'\n at ensureDirs (/app/src/slices/runtime/init/data/init.gateway.ts:52:7)\nпочини"
16+
from: eval-user
17+
- text: "залей в гит"
18+
from: eval-user
19+
delayMs: 5000
20+
- text: "у тебя уже есть токен, проверь секреты"
21+
from: eval-user
22+
delayMs: 8000
23+
successCriteria:
24+
- dimension: correctness
25+
description: "Correctly identifies the permission issue and applies a fix (e.g. try/catch, permission check, or recursive mkdir with error handling)"
26+
weight: 0.25
27+
- dimension: tool_usage
28+
description: "Uses file read → file write for the fix, exec for git commit/push, secret_get for credentials when push fails. No unnecessary tool calls."
29+
weight: 0.35
30+
- dimension: error_handling
31+
description: "On push auth failure: checks secrets immediately, does not loop or ask user for things it can look up. Max 1 hint from user before agent checks secrets."
32+
weight: 0.25
33+
- dimension: soul_compliance
34+
description: "Concise, action-first. No filler, no action plans, no emoji unless user uses them."
35+
weight: 0.15
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
id: tool-credential-recall-before-asking
2+
category: tool_use
3+
difficulty: medium
4+
name: Check stored credentials before asking user
5+
description: >
6+
Agent needs to perform an authenticated action. Instead of asking the user
7+
for credentials, it should first check secret_get for stored tokens.
8+
SOUL.md rule: "Try first, ask only if it fails."
9+
expectedBehavior: >
10+
Agent receives a task requiring auth (GitHub push). It should immediately
11+
try secret_get for relevant keys (github:token, github:password, etc.)
12+
before asking the user for any credentials. If found — use them.
13+
If not found — then ask, clearly stating what's missing.
14+
messages:
15+
- text: "Запуши последний коммит в cleanslice/runtime на гитхаб"
16+
from: eval-user
17+
successCriteria:
18+
- dimension: tool_usage
19+
description: "First tool call must be exec (git push) or secret_get — NOT a question to the user. If push fails with auth, next call must be secret_get."
20+
weight: 0.45
21+
- dimension: soul_compliance
22+
description: "SOUL.md: 'Try first, ask only if it fails' and 'Never ask for permission or prerequisites you can verify by trying.' Must not ask for token before trying."
23+
weight: 0.35
24+
- dimension: correctness
25+
description: "Completes the push if credentials exist, or gives clear error if they don't."
26+
weight: 0.20

src/slices/agent/memory/data/repositories/sqlite/sqlite.repository.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import { Database } from "bun:sqlite"
2+
import { mkdirSync } from "fs"
3+
import { dirname } from "path"
24
import type { MemoryEntry } from "../../../domain/memory.types"
35

46
export class SqliteRepository {
57
private db: Database
68

79
constructor(agentDir: string) {
8-
this.db = new Database(`${agentDir}/data/memory.sqlite`, { create: true })
10+
const dbPath = `${agentDir}/data/memory.sqlite`
11+
mkdirSync(dirname(dbPath), { recursive: true })
12+
this.db = new Database(dbPath, { create: true })
913
this.db.run(`
1014
CREATE TABLE IF NOT EXISTS memory (
1115
id TEXT PRIMARY KEY,

src/slices/runtime/runtime/runtime.module.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export class AgentRuntime {
5151
private router: BotService
5252
private runtimeService: RuntimeService
5353
private activityModule: ActivityModule
54+
private channelConfigs: RuntimeConfig["channels"]
5455
private s3sync?: S3SyncService
5556

5657
/**
@@ -59,6 +60,7 @@ export class AgentRuntime {
5960
*/
6061
constructor(config: RuntimeConfig) {
6162
this.config = config.init.config
63+
this.channelConfigs = config.channels
6264
const agentDir = config.init.agentDir
6365
const tools = config.tools ?? []
6466

@@ -244,6 +246,10 @@ export class AgentRuntime {
244246

245247
/** Wire cron and heartbeat — both emit synthetic internal messages. */
246248
private startBackgroundJobs(): void {
249+
// Skip background jobs when all channels are mock (e.g. paddock eval runs)
250+
const allMock = this.channelConfigs.every(c => c.type === "mock")
251+
if (allMock) return
252+
247253
this.cron.onJob(async job => {
248254
await this.handleMessage({
249255
id: randomUUID(), text: job.message,

0 commit comments

Comments
 (0)