机器人指出 agent.ts 的 #cwd 在构造时固定,/move 更新 SessionManager 与 进程 cwd 后不会重建 Agent,导致 GitLab Duo Agent 的 namespace/project 发现 持续读取旧仓库的 git remote。 按既有 resolver 模式(getReasoning/getServiceTier)修复: - Agent 新增可选 cwdResolver;构造时存入 #cwdResolver。 - AgentLoopConfig 新增 getCwd 每调用解析器,config 同时携带静态 cwd 与 getCwd。 - agent-loop 在 streamFunction 调用点计算 effectiveCwd = getCwd?.() ?? cwd, 每次 LLM 调用读取一次,因此运行中途的 /move 也能被工作区级 provider 发现 感知。 - sdk.ts 主 Agent 传入 cwdResolver: () => sessionManager.getCwd(),该值在 /move 时由 SessionManager.#cwd 更新。 新增针对可观测契约的回归测试(mock streamFn 记录 options.cwd):resolver 覆盖静态 cwd、resolver 返回 undefined 时回退静态 cwd、以及运行中途变更可被 逐次调用读取(模拟 /move)。
@oh-my-pi/pi-coding-agent
Core implementation package for the omp coding agent in the oh-my-pi monorepo.
For installation, setup, provider configuration, model roles, slash commands, and full CLI reference, see:
Package-specific references:
Memory backends
The agent supports three mutually-exclusive memory backends, selected via the memory.backend setting (Settings → Memory tab, or ~/.omp/config.yml):
off(default) — no memory subsystem runs.local— existing rollout-summarisation pipeline; writesmemory_summary.mdand consolidated artifacts under the agent dir.hindsight— talks to a Hindsight server (Cloud or self-hosted Docker), retains transcripts every Nth user turn, recalls memories on the first turn of a session, and exposesretain,recall, andreflect.
Hindsight quickstart
- Run a Hindsight server (Cloud or
docker run -p 8888:8888 ghcr.io/vectorize-io/hindsight:latest). - Set
memory.backend = "hindsight"andhindsight.apiUrl = "http://localhost:8888"(or your Cloud URL). - Optional environment overrides (env wins over settings):
HINDSIGHT_API_URL,HINDSIGHT_API_TOKEN— connectionHINDSIGHT_BANK_ID,HINDSIGHT_DYNAMIC_BANK_ID,HINDSIGHT_AGENT_NAME— bank addressingHINDSIGHT_AUTO_RECALL,HINDSIGHT_AUTO_RETAIN,HINDSIGHT_RETAIN_MODE— lifecycleHINDSIGHT_RECALL_BUDGET,HINDSIGHT_RECALL_MAX_TOKENS— recall sizingHINDSIGHT_BANK_MISSION,HINDSIGHT_DEBUG
Switching backends mid-session is honoured on the next system-prompt rebuild and the next /memory slash command. Existing users with memories.enabled = true|false are migrated to memory.backend = "local"|"off" exactly once on first launch.