Skip to content

Runtime: bound bash logs and skip runtime mirrors#66

Open
gaofeng21cn wants to merge 1 commit intoResearAI:mainfrom
gaofeng21cn:codex/upstream-runtime-log-hygiene
Open

Runtime: bound bash logs and skip runtime mirrors#66
gaofeng21cn wants to merge 1 commit intoResearAI:mainfrom
gaofeng21cn:codex/upstream-runtime-log-hygiene

Conversation

@gaofeng21cn
Copy link
Copy Markdown
Contributor

Problem

Long-running bash sessions can produce oversized terminal output that bloats rendered logs and ordinary file search. Stale session reconciliation also left an empty finished_at value when the metadata key existed with null.

Solution

  • Bound unterminated bash output buffers and truncate oversized single rendered terminal-log lines while keeping full content in log.jsonl.
  • Compact oversized completed terminal.log files into a byte-window view, preserving the original log as a quest-local backup path and recording compaction metadata on the session.
  • Fill empty finished_at during stale-session reconciliation.
  • Exclude heavy runtime mirrors under .ds/bash_exec, .ds/runs, .ds/codex_history, runner homes, evidence packets, slim backups, and cold archives from default explorer search.

MDS provenance

Adapted the generic runtime-log and search-hygiene parts of MedDeepScientist commits 60b8f07, 530ebb7, and b868449. MedDeepScientist, MAS, medical-fork, manuscript-readiness, and publication-authority semantics were intentionally excluded.

Tests

  • python -m py_compile src/deepscientist/bash_exec/monitor.py src/deepscientist/bash_exec/service.py src/deepscientist/quest/service.py
  • git diff --check
  • uv run --with pytest pytest -q tests/test_bash_exec_monitor.py tests/test_memory_and_artifact.py::test_explorer_search_skips_heavy_runtime_mirrors_by_default tests/test_mcp_servers.py::test_bash_exec_mcp_server_default_read_truncates_long_logs_with_hint tests/test_mcp_servers.py::test_bash_exec_mcp_server_read_supports_start_and_tail_windows tests/test_mcp_servers.py::test_bash_exec_mcp_server_seq_tail_reports_remaining_seq_ranges tests/test_daemon_api.py::test_bash_exec_handlers_expose_sessions_logs_and_stop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant