docs: fix inaccuracies found during documentation accuracy review

- CHANGELOG: inactivity_kill_secs default is disabled (None), not 120
- TROUBLESHOOTING: clarify inactivity_kill_secs is opt-in (must be
  passed explicitly); correct "default 120" claim
- MCP_TOOLS: inactivity_kill_secs is disabled by default; add note
  that Wine/macOS may not exit naturally even with ShutdownTerminal=1
- handlers/backtest.rs: remove stale comment claiming inactivity
  watchdog is "intentionally skipped when shutdown=true" — replaced
  with accurate description of the new 30s HTML-wait + kill behavior

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Devid HW
2026-04-25 09:14:44 +07:00
parent 4c34ae236c
commit 3ad67d4c57
4 changed files with 18 additions and 12 deletions
+2 -2
View File
@@ -17,8 +17,8 @@
`find_active_tester_agent_log` now prefers `Agent-127.0.0.1` and tiebreaks by file size.
### Added
- `launch_backtest` exposes `shutdown` (default `true`) and `inactivity_kill_secs` (default `120`)
as explicit tool parameters.
- `launch_backtest` exposes `shutdown` (default `true`) and `inactivity_kill_secs` (default: disabled;
set to e.g. `120` to enable the inactivity watchdog) as explicit tool parameters.
- Report DB stores deals in SQLite; all analytics tools resolve by `report_id` / `report_dir` / latest.
### Verified
+8 -4
View File
@@ -189,10 +189,14 @@ Fire-and-forget mode: compile → clean → launch MT5 backtest, return immediat
skip_clean?: boolean; // Skip cache cleaning
timeout?: number; // Max time in seconds (default: 900)
gui?: boolean; // Enable MT5 visualization
shutdown?: boolean; // Shut down MT5 after test (default: true)
inactivity_kill_secs?: number; // Kill MT5 if tester log silent for N seconds (default: 120).
// After silence, pipeline waits 30s for HTML then kills MT5.
// Set to 0 to disable. Useful to abort stalled EAs.
shutdown?: boolean; // Shut down MT5 after test (default: true).
// NOTE: on Wine/macOS terminal64.exe may not exit naturally
// even with ShutdownTerminal=1. Use inactivity_kill_secs too.
inactivity_kill_secs?: number; // Kill MT5 if tester log hasn't grown for N seconds
// (default: disabled / not set). Recommended: 120.
// After silence, pipeline polls for HTML report for 30s,
// then kills MT5 unconditionally. If HTML present → extracted;
// otherwise falls back to journal extraction (no P&L data).
}
```
+3 -2
View File
@@ -82,8 +82,9 @@ growing (test done), waits 30 seconds polling for the HTML file, then kills `ter
unconditionally. If the HTML appears during the wait it is extracted; otherwise journal extraction
provides deal counts and final balance (but no per-deal P&L).
**To maximise HTML report chances:** Use `inactivity_kill_secs=120` (default) with `shutdown=true`
(default). This gives MT5 120s of quiet time + 30s of HTML-wait before the kill.
**To maximise HTML report chances:** Pass `inactivity_kill_secs=120` explicitly (it is disabled by
default). With `shutdown=true` (default) this gives MT5 120s of quiet time + 30s of HTML-wait before
the kill.
```
launch_backtest(expert: "MyEA", shutdown: true, inactivity_kill_secs: 120)
+5 -4
View File
@@ -338,10 +338,11 @@ pub async fn handle_launch_backtest(handler: &crate::tools::handlers::ToolHandle
skip_clean: args.get("skip_clean").and_then(|v| v.as_bool()).unwrap_or(false),
skip_analyze: true, // Not needed for launch mode
deep_analyze: false,
// ShutdownTerminal=1 (default): MT5 writes the HTML report and exits cleanly.
// The background monitor's post-exit scan finds the report within 10s.
// The inactivity watchdog is intentionally skipped when shutdown=true so it
// doesn't race with MT5's report write right before natural exit.
// On Wine/macOS, ShutdownTerminal=1 does NOT reliably cause terminal64.exe to exit.
// When inactivity_kill_secs is set, the monitor waits that many seconds after the
// tester log goes quiet, then polls for the HTML report for 30 s, then kills MT5.
// If no inactivity_kill_secs is given (default None → disabled), the monitor relies
// solely on timeout (900 s) or natural MT5 exit for completion detection.
shutdown: args.get("shutdown").and_then(|v| v.as_bool()).unwrap_or(true),
kill_existing: false,
timeout: args.get("timeout").and_then(|v| v.as_u64()).unwrap_or(900),