Skip to content

Rename CodeActAgent to Agent and update folder structure - #78

Merged
xingyaoww merged 2 commits into
mainfrom
openhands/rename-codeactagent-to-agent
Sep 3, 2025
Merged

xingyaoww merged 2 commits into
mainfrom
openhands/rename-codeactagent-to-agent

Conversation

@xingyaoww

Copy link
Copy Markdown
Contributor

Summary

This PR addresses issue #77 by renaming CodeActAgent to Agent and updating the folder structure throughout the codebase.

Changes Made

Core Changes

  • Renamed folder: openhands/core/agent/codeact_agent/ → openhands/core/agent/agent/
  • Renamed file: codeact_agent.py → agent.py
  • Renamed class: CodeActAgent → Agent

Updated Imports and References

  • Updated all import statements across the codebase (7 files)
  • Updated openhands/core/__init__.py to export Agent instead of CodeActAgent
  • Updated openhands/core/agent/__init__.py to import from the new location
  • Updated comment reference in fn_call_converter.py

Updated Examples

  • examples/hello_world.py: Updated to use Agent class
  • examples/hello_world_with_registry.py: Updated to use Agent class

Updated Tests

  • tests/test_hello_world_integration.py: Updated all references to use Agent class
  • Fixed missing __init__.py file in openhands/core/tests/conversation/

Updated Documentation

  • README.md: Updated directory structure documentation

Testing

  • ✅ All integration tests pass (4/4)
  • ✅ Pre-commit hooks pass (formatting, linting, type checking)
  • ✅ Agent class can be imported successfully from openhands.core
  • ✅ Old CodeActAgent import correctly fails
  • ✅ Agent instantiation works as expected

Backward Compatibility

This is a breaking change that renames the main agent class. Users will need to update their imports from:

from openhands.core import CodeActAgent

to:

from openhands.core import Agent

Fixes

Closes #77

@xingyaoww can click here to continue refining the PR

- Renamed openhands/core/agent/codeact_agent/ folder to agent/
- Renamed codeact_agent.py to agent.py
- Updated CodeActAgent class name to Agent
- Updated all import statements throughout the codebase
- Updated examples to use new Agent class
- Updated integration tests to use new Agent class
- Updated README.md documentation
- Fixed missing __init__.py file in tests/conversation/

Fixes #77

Co-authored-by: openhands <openhands@all-hands.dev>
@xingyaoww
xingyaoww enabled auto-merge (squash) September 3, 2025 17:26
@xingyaoww
xingyaoww merged commit 27bdcd5 into main Sep 3, 2025
@xingyaoww
xingyaoww deleted the openhands/rename-codeactagent-to-agent branch September 3, 2025 17:27
StressTestor pushed a commit to StressTestor/software-agent-sdk that referenced this pull request Jun 1, 2026
Co-authored-by: openhands <openhands@all-hands.dev>
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.

Rename CodeActAgent to Agent

2 participants