Skip to content

[codex] Implement runtime memory alignment pipeline#5

Closed
ruttydm wants to merge 1 commit intomainfrom
codex/runtime-memory-alignment
Closed

[codex] Implement runtime memory alignment pipeline#5
ruttydm wants to merge 1 commit intomainfrom
codex/runtime-memory-alignment

Conversation

@ruttydm
Copy link
Copy Markdown
Contributor

@ruttydm ruttydm commented Apr 10, 2026

What changed

This PR lands a broad runtime-memory alignment pass in OpenCompany.

It adds the new memory/runtime services and wiring for:

  • context budgeting
  • context pruning
  • structured compaction planning
  • compaction memory extraction
  • prompt frame splitting
  • tool-result deduplication
  • oversized tool-output truncation
  • conversation summary failure tracking

It also updates related agent/runtime jobs, provider gateways, config, docs, Lua docs, and tests, while removing obsolete planning/todo docs.

Why

OpenCompany has been moving toward the stronger runtime patterns already explored in KosmoKrator and prism-relay. This branch consolidates that work into product code and accompanying documentation so prompt construction, compaction, flushing, and tool-output handling are more explicit and easier to evolve.

Impact

  • Better prompt hygiene and context-pressure handling in agent flows.
  • More explicit memory budgeting and compaction behavior.
  • New test coverage for several of the new runtime helpers.
  • Significant docs cleanup and replacement of stale planning artifacts with architecture/alignment docs.

Validation

Focused test execution was attempted with vendor/bin/phpunit because the repo's Composer test script still points to php artisan test, which is not available in this app.

Failed checks:

  • vendor/bin/phpunit tests/Unit/PromptFrameBuilderTest.php tests/Unit/ToolResultDeduplicatorTest.php tests/Unit/OutputTruncatorTest.php tests/Unit/ContextPrunerTest.php tests/Unit/PrismMessagesTest.php
    • 1 failure: Tests\\Unit\\PrismMessagesTest::test_from_laravel_messages_preserves_assistant_tool_calls_and_tool_results
  • vendor/bin/phpunit tests/Feature/Services/Memory/ConversationCompactionServiceTest.php tests/Feature/Services/Memory/MemoryFlushServiceTest.php tests/Feature/Services/Memory/ModelContextRegistryTest.php tests/Feature/OpenCompanyAgentTest.php
    • 4 errors and 3 failures, including summary persistence assertions and Illuminate\\Support\\MultipleInstanceManager resolution errors through Promptable

Notes

This PR is intentionally opened as draft because the current branch does not have a passing focused test baseline yet.

@ruttydm
Copy link
Copy Markdown
Contributor Author

ruttydm commented Apr 10, 2026

Superseded by #6, which merges the runtime memory work together with the integration refactor and the dev-branch follow-up fixes.

@ruttydm ruttydm closed this Apr 10, 2026
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