Skip to content

#1 Persistent memory for AI coding agents based on real-world benchmarks

fix(observability): tame log defaults + user config override (closes #519) (#686)

Rohit Ghumare6d9bfedc43aa
diff --git a/iii-config.docker.yaml b/iii-config.docker.yaml
index aa6c3b99..682236ec 100644
--- a/iii-config.docker.yaml
+++ b/iii-config.docker.yaml
@@ -40,10 +40,11 @@ workers:
enabled: true
service_name: agentmemory
exporter: memory
- sampling_ratio: 1.0
+ # See iii-config.yaml for the rationale on 0.1 / console-off (#519).
+ sampling_ratio: 0.1
metrics_enabled: true
logs_enabled: true
- logs_console_output: true
+ logs_console_output: false
- name: iii-exec
config:
watch:
diff --git a/iii-config.yaml b/iii-config.yaml
index f7e0f188..62892f51 100644
--- a/iii-config.yaml
+++ b/iii-config.yaml
@@ -40,10 +40,19 @@ workers:
enabled: true
service_name: agentmemory
exporter: memory
- sampling_ratio: 1.0
+ # 0.1 instead of 1.0: at full sampling under sustained load the
+ # log subscriber falls behind, the worker emits a "Log trigger
+ # subscriber lagged" WARN, and that WARN re-enters the same
+ # stream the subscriber is failing to drain — a positive
+ # feedback loop that wrote 137 GB to daemon.log.new on one user
+ # in a few days (#519).
+ sampling_ratio: 0.1
metrics_enabled: true
logs_enabled: true
- logs_console_output: true
+ # Console output is off by default; the feedback path needs the
+ # console layer to amplify. Re-enable per-session via env if you
+ # need verbose tracing for debugging.
+ logs_console_output: false
- name: iii-exec
config:
watch:
diff --git a/src/cli.ts b/src/cli.ts
index 146efd8a..d97d655e 100644
--- a/src/cli.ts
+++ b/src/cli.ts
@@ -302,10 +302,18 @@ async function isAgentmemoryReady(): Promise<boolean> {
}
function findIiiConfig(): string {
+ // Precedence (user-overridable wins): explicit env > project cwd >
+ // ~/.agentmemory/ > bundled. The bundled config used to win
+ // unconditionally, so users hitting the observability log-feedback
+ // loop (#519) had no way to drop a tamer config in place without
+ // editing node_modules.
+ const envPath = process.env["AGENTMEMORY_III_CONFIG"];
const candidates = [
+ ...(envPath ? [envPath] : []),
+ join(process.cwd(), "iii-config.yaml"),
+ join(homedir(), ".agentmemory", "iii-config.yaml"),
join(__dirname, "iii-config.yaml"),
join(__dirname, "..", "iii-config.yaml"),
- join(process.cwd(), "iii-config.yaml"),
];
for (const c of candidates) {
if (existsSync(c)) return c;