Skip to content

Commit 348f608

Browse files
fix(types): address Greptile review feedback
Three issues from Greptile's review (4/5 confidence, all P1/P2): 1. Back-compat shim at `agentex.lib.types.acp` was missing two public names from the original module: `RPC_SYNC_METHODS` and `PARAMS_MODEL_BY_METHOD`. External consumers importing those from the old path would have hit ImportError, breaking the PR's "zero install- time impact" guarantee. Added both to the re-export list. 2. `agentex.protocol.json_rpc` silently dropped `from_attributes=True` and `populate_by_name=True` config when switching from `model_utils.BaseModel` to plain `pydantic.BaseModel`. Restored via an explicit `model_config = ConfigDict(...)` on all three classes, with a comment explaining why. The previous version inherited these flags transitively; making them explicit + documented avoids drift. 3. All 10 CLI scaffolding templates (`agentex init`) generated `from agentex.lib.types.acp import ...` — works via the shim but immediately stale on the day this PR establishes `agentex.protocol.acp` as canonical. Updated all templates to use the new path so scaffolded code starts on the right foot. Verified locally: - ruff check . → All checks passed - shim re-exports all 7 original symbols (5 classes + 2 module-level constants), identity-checked vs canonical - JSONRPCRequest/Response/Error all have `model_config.get('from_attributes') is True` and `populate_by_name is True` Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7590970 commit 348f608

12 files changed

Lines changed: 25 additions & 11 deletions

File tree

src/agentex/lib/cli/templates/default-langgraph/project/acp.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import agentex.lib.adk as adk
1818
from agentex.lib.adk import create_langgraph_tracing_handler, stream_langgraph_events
1919
from agentex.lib.core.tracing.tracing_processor_manager import add_tracing_processor_config
2020
from agentex.lib.sdk.fastacp.fastacp import FastACP
21-
from agentex.lib.types.acp import SendEventParams, CancelTaskParams, CreateTaskParams
21+
from agentex.protocol.acp import SendEventParams, CancelTaskParams, CreateTaskParams
2222
from agentex.lib.types.fastacp import AsyncACPConfig
2323
from agentex.lib.types.tracing import SGPTracingProcessorConfig
2424
from agentex.lib.utils.logging import make_logger

src/agentex/lib/cli/templates/default-pydantic-ai/project/acp.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ from agentex.lib.adk import (
2828
stream_pydantic_ai_events,
2929
create_pydantic_ai_tracing_handler,
3030
)
31-
from agentex.lib.types.acp import SendEventParams, CancelTaskParams, CreateTaskParams
31+
from agentex.protocol.acp import SendEventParams, CancelTaskParams, CreateTaskParams
3232
from agentex.lib.types.fastacp import AsyncACPConfig
3333
from agentex.lib.types.tracing import SGPTracingProcessorConfig
3434
from agentex.lib.utils.logging import make_logger

src/agentex/lib/cli/templates/default/project/acp.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from agentex.lib.sdk.fastacp.fastacp import FastACP
22
from agentex.lib.types.fastacp import AsyncACPConfig
3-
from agentex.lib.types.acp import SendEventParams, CancelTaskParams, CreateTaskParams
3+
from agentex.protocol.acp import SendEventParams, CancelTaskParams, CreateTaskParams
44
from agentex.lib.utils.logging import make_logger
55
from agentex.types.text_content import TextContent
66
from agentex.lib import adk

src/agentex/lib/cli/templates/sync-langgraph/project/acp.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import agentex.lib.adk as adk
1111
from agentex.lib.adk import create_langgraph_tracing_handler, convert_langgraph_to_agentex_events
1212
from agentex.lib.core.tracing.tracing_processor_manager import add_tracing_processor_config
1313
from agentex.lib.sdk.fastacp.fastacp import FastACP
14-
from agentex.lib.types.acp import SendMessageParams
14+
from agentex.protocol.acp import SendMessageParams
1515
from agentex.lib.types.tracing import SGPTracingProcessorConfig
1616
from agentex.lib.utils.logging import make_logger
1717
from agentex.types.task_message_content import TaskMessageContent

src/agentex/lib/cli/templates/sync-openai-agents/project/acp.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from typing import AsyncGenerator, List
44
from agentex.lib import adk
55
from agentex.lib.adk.providers._modules.sync_provider import SyncStreamingProvider, convert_openai_to_agentex_events
66
from agentex.lib.sdk.fastacp.fastacp import FastACP
7-
from agentex.lib.types.acp import SendMessageParams
7+
from agentex.protocol.acp import SendMessageParams
88
from agentex.lib.core.tracing.tracing_processor_manager import add_tracing_processor_config
99
from agentex.lib.types.tracing import SGPTracingProcessorConfig
1010
from agentex.lib.utils.model_utils import BaseModel

src/agentex/lib/cli/templates/sync-pydantic-ai/project/acp.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ from agentex.lib.adk import (
2222
create_pydantic_ai_tracing_handler,
2323
convert_pydantic_ai_to_agentex_events,
2424
)
25-
from agentex.lib.types.acp import SendMessageParams
25+
from agentex.protocol.acp import SendMessageParams
2626
from agentex.lib.types.tracing import SGPTracingProcessorConfig
2727
from agentex.lib.utils.logging import make_logger
2828
from agentex.lib.sdk.fastacp.fastacp import FastACP

src/agentex/lib/cli/templates/sync/project/acp.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import AsyncGenerator, Union
22
from agentex.lib.sdk.fastacp.fastacp import FastACP
3-
from agentex.lib.types.acp import SendMessageParams
3+
from agentex.protocol.acp import SendMessageParams
44

55
from agentex.types.task_message_update import TaskMessageUpdate
66
from agentex.types.task_message_content import TaskMessageContent

src/agentex/lib/cli/templates/temporal-openai-agents/project/workflow.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import os
44
from temporalio import workflow
55

66
from agentex.lib import adk
7-
from agentex.lib.types.acp import CreateTaskParams, SendEventParams
7+
from agentex.protocol.acp import CreateTaskParams, SendEventParams
88
from agentex.lib.core.temporal.workflows.workflow import BaseWorkflow
99
from agentex.lib.core.temporal.types.workflow import SignalName
1010
from agentex.lib.utils.logging import make_logger

src/agentex/lib/cli/templates/temporal-pydantic-ai/project/workflow.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ from temporalio import workflow
2323
from project.agent import TaskDeps, temporal_agent
2424

2525
from agentex.lib import adk
26-
from agentex.lib.types.acp import SendEventParams, CreateTaskParams
26+
from agentex.protocol.acp import SendEventParams, CreateTaskParams
2727
from agentex.lib.types.tracing import SGPTracingProcessorConfig
2828
from agentex.lib.utils.logging import make_logger
2929
from agentex.types.text_content import TextContent

src/agentex/lib/cli/templates/temporal/project/workflow.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import json
33
from temporalio import workflow
44

55
from agentex.lib import adk
6-
from agentex.lib.types.acp import CreateTaskParams, SendEventParams
6+
from agentex.protocol.acp import CreateTaskParams, SendEventParams
77
from agentex.lib.core.temporal.workflows.workflow import BaseWorkflow
88
from agentex.lib.core.temporal.types.workflow import SignalName
99
from agentex.lib.utils.logging import make_logger

0 commit comments

Comments
 (0)