Skip to content

feat(api): export helpers that host facades re-export - #43

Merged
zhanghanduo merged 4 commits into
mainfrom
feat/public-host-helpers
Sep 25, 2026
Merged

zhanghanduo merged 4 commits into
mainfrom
feat/public-host-helpers

Conversation

@zhanghanduo

@zhanghanduo zhanghanduo commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Hosts wrap AgentCore modules as compatibility facades (from agent_core.X import * + sys.modules[__name__] = X). Two helpers every host needs were invisible through that pattern, so each host hand-writes extra re-exports:

  • loop_types.wall_deadline_remaining_s is public and used by every host's AgentLoopHooks(wall_deadline_remaining=...), but was missing from __all__. Added.
  • model_profile._to_openai_tool_calls is imported by hosts that build assistant messages by hand (ApodexHarness re-exports it as to_openai_tool_calls for that reason). Renamed to public to_openai_tool_calls; _to_openai_tool_calls stays as an alias, so nothing breaks.

Scoped deliberately: other private names FrontierAgent touched during its migration (ApodexAI/FrontierAgent#50) turned out to have public equivalents already (bind_max_tokens, agent_core.retry_policy) or are test-only, so they stay private.

Changelog entry (suggested, under Added)

  • loop_types.wall_deadline_remaining_s is listed in __all__; model_profile.to_openai_tool_calls is public (the _to_openai_tool_calls name remains an alias).

Test plan

  • New tests/test_public_host_helpers.py (star import exposes both; alias identity)
  • Existing test_model_profile_native.py moved to the public name
  • ruff, pyright agent_core, full pytest -q

🤖 Generated with Claude Code

Release workflow

Uses the shared centralized-release workflow in #44. This PR keeps the current package version and contributes its own independent changes/ fragment. Version, lockfile and changelog aggregation happen in a later release PR. #40, #42 and #43 were tested in all six merge orders without conflicts.

zhanghanduo and others added 4 commits September 25, 2026 13:28
- loop_types.__all__ now lists wall_deadline_remaining_s, which the loop
  hooks of every host use but star-import facades could not see.
- model_profile._to_openai_tool_calls becomes public to_openai_tool_calls;
  the private name stays as an alias.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@zhanghanduo
zhanghanduo merged commit 62c5728 into main Sep 25, 2026
5 checks passed
@zhanghanduo
zhanghanduo deleted the feat/public-host-helpers branch September 25, 2026 06:23
@zhanghanduo zhanghanduo mentioned this pull request Sep 25, 2026
4 tasks
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