Skip to content

refactor(agent-core): split RuntimeConfig into Kaos and ToolServices - #185

Merged
kermanx merged 2 commits into
MoonshotAI:mainfrom
kermanx:fix/runtime-kaos-split
May 29, 2026
Merged

refactor(agent-core): split RuntimeConfig into Kaos and ToolServices#185
kermanx merged 2 commits into
MoonshotAI:mainfrom
kermanx:fix/runtime-kaos-split

Conversation

@kermanx

@kermanx kermanx commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

N/A — this is a continuation of an in-flight internal refactor.

Problem

The staged refactor split the old RuntimeConfig (which bundled kaos + url tools) into two separate fields (kaos: Kaos and toolServices?: ToolServices), but the migration was incomplete:

  • Several source files still referenced the old agent.runtime property.
  • Test code passed kaos nested inside toolServices (or runtime), causing Cannot read properties of undefined (reading 'getcwd') failures.
  • BashTool constructor signature changed (removed standalone environment arg) but tests were not updated.
  • Type-check errors remained in runtime.test.ts and builtin-current.test.ts.

What changed

  • Updated all source references from agent.runtime.kaos to agent.kaos.
  • Fixed test harness (AgentTestContext) and all session/agent/tool tests to pass kaos directly to Agent / Session constructors.
  • Updated BashTool test invocations to embed osEnv into createFakeKaos(...) instead of passing it as a third positional arg.
  • Fixed a bug in Session.instantiateAgent where agent cwd was incorrectly set to gethome() instead of getcwd().
  • Added changeset for @moonshot-ai/agent-core and @moonshot-ai/kimi-code.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented May 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d9e95ae

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@moonshot-ai/agent-core Patch
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented May 29, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@d9e95ae
npx https://pkg.pr.new/@moonshot-ai/kimi-code@d9e95ae

commit: d9e95ae

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 892b1ce4a8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/agent-core/src/rpc/core-impl.ts
Comment thread .changeset/split-runtime-kaos.md
Comment thread packages/agent-core/src/session/index.ts Outdated
@kermanx
kermanx merged commit 114777e into MoonshotAI:main May 29, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request May 29, 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