Skip to content

Runtime compression status and artifact extraction contract#21

Merged
1aal merged 5 commits into
apecloud-basefrom
fix/runtime-compression-artifact-contract-111
Jun 10, 2026
Merged

Runtime compression status and artifact extraction contract#21
1aal merged 5 commits into
apecloud-basefrom
fix/runtime-compression-artifact-contract-111

Conversation

@1aal

@1aal 1aal commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • keep PR Runtime compression status and artifact extraction contract #21 wrapper-only: no changes to native Hermes Agent core files under agent/* or run_agent.py
  • codify Runtime worker LLM config resolution so Cloud run config with endpoint credentials is normalized to Hermes custom with the same model/base_url/api_key; this covers both explicit openai-compatible and display-provider names such as Qwen when base_url + api_key are present
  • leave model limit entries in the Runtime wrapper contract: max_tokens is passed into AIAgent, and context_length is applied to the agent/compressor config so Hermes native compression can use the configured context window
  • project existing Runtime status messages about context compression degraded/failed into structured JSONL events in Runtime worker so Cloud can mark warning/partial without reading pod logs
  • preserve report artifact metadata/download behavior: no local paths and no full artifact content in turn events

Notes

  • This does not change native Hermes Agent compression behavior. It surfaces existing compression warnings from the Runtime wrapper layer and feeds runtime config into existing Agent/compressor paths.
  • P0 auxiliary LLM policy: if Cloud provides a complete run llm_config, Runtime should make that provider/model/base_url/api_key available to the Agent and compression auxiliary path; if unavailable, Runtime emits structured compression degraded/failed events for Cloud to display as warning/partial.
  • Provider display names must not decide compression routing when Cloud provides an explicit endpoint. For example, provider=Qwen plus baseURL/apiKey is routed as custom + base_url + api_key so auxiliary compression reuses the same Cloud run endpoint instead of Hermes' built-in Qwen/Alibaba provider path.
  • Supported limit fields are canonical max_tokens and context_length; camelCase aliases are accepted from the worker request for compatibility, and context_window aliases are accepted only as migration compatibility into canonical context_length.
  • This PR intentionally does not provide a Runtime /extract API or bounded report-content extraction. Report summarization should rely on Hermes native context compression, not a separate Cloud/Runtime summary feature.
  • Cloud still needs to project the new structured compression events.

Verification

  • uv run --extra dev pytest tests/runtime_manager/test_registry.py::test_runtime_worker_treats_named_cloud_provider_with_endpoint_as_custom tests/runtime_manager/test_registry.py::test_runtime_worker_resolves_model_limit_entries_from_llm_config tests/runtime_manager/test_registry.py::test_runtime_worker_applies_context_length_to_agent_compressor tests/runtime_manager/test_registry.py::test_runtime_worker_resolves_cloud_llm_config_for_agent_and_auxiliary tests/runtime_manager/test_registry.py::test_runtime_worker_normalizes_cloud_provider_aliases_to_hermes_names tests/runtime_manager/test_registry.py::test_runtime_worker_projects_compression_status_as_structured_event tests/runtime_manager/test_report_artifacts.py -q
  • uv run --extra dev ruff check runtime_manager/worker_main.py tests/runtime_manager/test_registry.py
  • python3 -m py_compile runtime_manager/worker_main.py
  • git diff --check
  • git diff --check origin/apecloud-base...HEAD

Related to task NousResearch#111 / issue apecloud/apecloud#18712.

@1aal 1aal force-pushed the fix/runtime-compression-artifact-contract-111 branch from 3b90a89 to 951e7ad Compare June 10, 2026 03:52
@1aal 1aal changed the title Runtime compression warnings and artifact extraction contract Runtime compression status and artifact extraction contract Jun 10, 2026
@1aal 1aal marked this pull request as ready for review June 10, 2026 07:38
@1aal 1aal merged commit d1d09c9 into apecloud-base Jun 10, 2026
7 checks passed
@1aal 1aal deleted the fix/runtime-compression-artifact-contract-111 branch June 10, 2026 07:38
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