Skip to content

feat: improve configuration, memory management, and docs - #129

Open
3210448723 wants to merge 1 commit into
Alpha-Dojo:mainfrom
3210448723:agent/improve-docs-and-test-reliability
Open

feat: improve configuration, memory management, and docs#129
3210448723 wants to merge 1 commit into
Alpha-Dojo:mainfrom
3210448723:agent/improve-docs-and-test-reliability

Conversation

@3210448723

Copy link
Copy Markdown

Summary

This pull request improves DojoAgents documentation, provider configuration,
generated-memory management, and runtime reliability.

Changes

  • Add bilingual agent internals documentation covering the runtime, agent loop,
    tools, events, memory, plugins, and multi-agent planning.
  • Add bilingual known-limitations documentation with explicit behavioral
    boundaries and validation status.
  • Extend OpenAI-compatible provider configuration with token and context-window
    settings, including dashboard configuration support.
  • Add a dashboard API for deleting generated memory with path validation and
    post-deletion verification.
  • Improve portfolio migration compatibility and market-data fallback behavior.
  • Honor both provider and request token limits for MCP sampling.
  • Avoid unnecessary turn-intent classification when no conversation history is
    available.
  • Update affected tests and stale fixtures to match current runtime contracts.

Validation

  • 141 targeted regression tests passed.
  • Ruff checks passed.
  • MkDocs strict build passed.
  • Dashboard frontend build passed.

The full test suite was not reported as completed because the single-process run
encountered prolonged filesystem I/O stalls.

Known dependency issue

npm audit currently reports one high-severity issue in the transitive
postcss@8.5.15 dependency. This pull request does not modify the dependency
lockfile and records the issue as a known limitation.

Document agent internals and known limitations in English and Chinese. Extend provider configuration and generated-memory management, and improve runtime, migration, market-data, and MCP reliability with regression coverage.
Copilot AI review requested due to automatic review settings August 3, 2026 10:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves DojoAgents’ configurability and operational ergonomics by extending OpenAI-compatible provider limits, adding a Dashboard API to clear generated skill-memory safely, improving market-data fallback behavior, and significantly expanding bilingual internal documentation (including a “known limitations” register).

Changes:

  • Extend provider configuration to support context_window and max_tokens, propagate limits through runtime/dashboard/MCP sampling, and add frontend form controls.
  • Add a Dashboard DELETE /api/v1/memory/generated-skills endpoint backed by a new generated-memory service with deletion verification and safety checks.
  • Improve runtime reliability/performance (skip turn-intent classification when no history; bulk kline snapshot indexing + per-symbol fallback) and update tests/docs accordingly.

Reviewed changes

Copilot reviewed 63 out of 63 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_turn_intent.py Adds regression coverage for skipping turn-intent classification without history.
tests/test_runtime_multi_agent_plan.py Ensures runtime wires OpenAI-compatible provider routing and output limits correctly.
tests/test_openai_provider_usage.py Expands provider behavior tests (minimal request shape, author-prefixing, streaming tool-call metadata, reasoning field parsing).
tests/test_mcp_advanced.py Updates MCP tests and adds coverage for sampling output-limit min(config, request).
tests/test_gateway_state.py Updates integrated loop expectations to account for additional LLM calls (e.g., intent classifier).
tests/test_dashboard_config_update.py Ensures dashboard config updates sync agent model when default provider changes.
tests/test_dashboard_chat_openai.py Verifies runtime sync preserves OpenAI-compatible provider limits and context window.
tests/test_config_multi_agent_plan.py Adds config parsing coverage for provider max_tokens.
tests/test_cli_gateway_setup.py Adjusts gateway setup tests to capture log output instead of stdout where appropriate.
tests/test_built_in_plugins.py Removes the example-plugin loading test (likely reflecting plugin set/behavior changes).
tests/test_agent_loop_integrated.py Updates integrated loop assertions to account for additional LLM call(s).
tests/dashboard/stores/test_portfolio_migration.py Updates portfolio migration tests for current schema normalization and backup behavior.
tests/dashboard/routers/test_memory.py New tests for generated-memory deletion endpoint behavior and safety edge cases.
tests/dashboard/routers/conftest.py Extends test doubles to match updated router/service expectations.
mkdocs.yml Adds new bilingual nav entries for “Agent Internals” and “Known Limitations”.
dojoagents/tools/mcp_tool.py Honors both provider and request token limits for MCP sampling; aligns SSE import for patchability in tests.
dojoagents/dashboard/web/src/types/settings.ts Extends provider form types to include context_window and max_tokens.
dojoagents/dashboard/web/src/components/settings/SettingsModal.tsx Adds UI fields and patch logic for provider context_window / max_tokens.
dojoagents/dashboard/services/portfolio_store.py Adjusts migration logic to preserve an explicit v2 intermediate state before v3 conversion.
dojoagents/dashboard/services/generated_memory_service.py Introduces a generated-memory clearing service with path validation and deletion verification.
dojoagents/dashboard/services/dojo_data_gateway.py Adds bulk kline indexing (warm/cache) with correct fallback behavior for windows and missing symbols.
dojoagents/dashboard/server.py Propagates provider max_tokens into runtime provider wiring; registers new memory router.
dojoagents/dashboard/schemas/memory.py Adds response schema for generated-memory clearing endpoint.
dojoagents/dashboard/routers/memory.py Adds DELETE /api/v1/memory/generated-skills endpoint using threadpool execution and structured errors.
dojoagents/config/models.py Adds LLMProviderConfig.max_tokens; allows explicit null for web tool backends.
dojoagents/config/loader.py Parses provider max_tokens; preserves explicit null for web tool backends (no silent defaulting).
dojoagents/agent/turn_intent.py Skips intent classification when no session history is present.
dojoagents/agent/runtime.py Passes provider max_tokens into OpenAI-compatible provider construction.
dojoagents/agent/providers.py Adds provider-level max_tokens support and improves reasoning extraction across response variants.
docs/site/zh/reference/dashboard-api.md Documents dashboard security boundary and new memory deletion API.
docs/site/zh/reference/configuration.md Documents provider max_tokens and explicit null disabling for web tools; references known limitations.
docs/site/zh/getting-started/model-configuration.md Adds guidance for custom OpenAI-compatible providers including limits.
docs/site/zh/development/repository-map.md Updates repository map with links to new “Agent Internals” doc and extension guidance.
docs/site/zh/development/known-limitations.md Adds bilingual “known limitations” register (ZH).
docs/site/zh/development/index.md Adds “Known Limitations” link in development index (ZH).
docs/site/zh/development/adding-tools.md Adds further reading link to “Agent Internals” (ZH).
docs/site/zh/architecture/tools-and-sandbox.md Adds “Agent Internals” cross-link (ZH).
docs/site/zh/architecture/runtime.md Adds “Agent Internals” cross-link (ZH).
docs/site/zh/architecture/plugins.md Adds “Agent Internals” cross-link (ZH).
docs/site/zh/architecture/overview.md Updates architecture overview to reflect Strands kernel + bridges; adds further reading links (ZH).
docs/site/zh/architecture/multi-agent-planning.md Adds “Agent Internals” cross-link (ZH).
docs/site/zh/architecture/memory.md Adds “Agent Internals” cross-link (ZH).
docs/site/zh/architecture/index.md Adds “Agent Internals” entry (ZH).
docs/site/zh/architecture/event-driven.md Adds “Agent Internals” cross-link (ZH).
docs/site/zh/architecture/agent-loop.md Adds pointer to “Agent Internals” for real implementation (ZH).
docs/site/zh/architecture/agent-internals.md New deep-dive “Agent Internals” documentation (ZH).
docs/site/en/reference/dashboard-api.md Documents dashboard security boundary and new memory deletion API.
docs/site/en/reference/configuration.md Documents provider max_tokens and explicit null disabling for web tools; references known limitations.
docs/site/en/getting-started/model-configuration.md Adds guidance for custom OpenAI-compatible providers including limits.
docs/site/en/development/repository-map.md Updates repository map with “Agent Internals” links and extension guidance.
docs/site/en/development/known-limitations.md Adds bilingual “known limitations” register (EN).
docs/site/en/development/index.md Adds “Known Limitations” link in development index (EN).
docs/site/en/development/adding-tools.md Adds further reading link to “Agent Internals” (EN).
docs/site/en/architecture/tools-and-sandbox.md Adds “Agent Internals” cross-link (EN).
docs/site/en/architecture/runtime.md Adds “Agent Internals” cross-link (EN).
docs/site/en/architecture/plugins.md Adds “Agent Internals” cross-link (EN).
docs/site/en/architecture/overview.md Updates architecture overview to reflect Strands kernel + bridges; adds further reading links (EN).
docs/site/en/architecture/multi-agent-planning.md Adds “Agent Internals” cross-link (EN).
docs/site/en/architecture/memory.md Adds “Agent Internals” cross-link (EN).
docs/site/en/architecture/index.md Adds “Agent Internals” entry (EN).
docs/site/en/architecture/event-driven.md Adds “Agent Internals” cross-link (EN).
docs/site/en/architecture/agent-loop.md Adds pointer to “Agent Internals” for real implementation (EN).
docs/site/en/architecture/agent-internals.md New deep-dive “Agent Internals” documentation (EN).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +30 to +35
for child in target.iterdir():
if child.is_symlink() or not child.is_dir():
child.unlink()
else:
shutil.rmtree(child, onexc=self._force_remove)
deleted_count += 1
Comment on lines +56 to +63
@staticmethod
def _validate_target(target: Path) -> None:
absolute = target.absolute()
home = Path.home().absolute()
if absolute == Path(absolute.anchor) or absolute == home:
raise UnsafeGeneratedMemoryPathError(
f"Refusing to clear unsafe generated memory path: {target}"
)
@kyokagong-alphadojo

Copy link
Copy Markdown
Contributor

Hi, we are currently in the process of migrating new features to the feat/harness-v2 branch. Please submit your PR against that branch instead. We plan to merge feat/harness-v2 into the main branch in the next 1–2 weeks. Thank you for your contribution!

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.

3 participants