Skip to content

Agent Context

osa_tool.osa_agent.context

AgentContext

Shared execution context passed to all agents.

This object aggregates configuration, repository metadata, model handlers, and workflow-related utilities so that agents do not need to resolve or construct these dependencies themselves.

__init__(agent_config)

Initialize the context from the OSA configuration.

Sets agent_config, config_manager, git_agent, metadata, workflow_manager, prompts, create_fork, create_pull_request, and delete_repo from the given config.

get_model_handler(task_type='general')

Get a model handler configured for a specific task type.

Parameters:

Name Type Description Default
task_type str

Type of task (docstring, readme, validation, general).

'general'

Returns:

Type Description
ModelHandler

ModelHandler instance configured for the specified task.