Skip to content

[chore] Remove the /load-session endpoint and dead session-store scaffolding#4828

Merged
mmabrouk merged 3 commits into
big-agentsfrom
chore/agent-remove-load-session
Jun 25, 2026
Merged

[chore] Remove the /load-session endpoint and dead session-store scaffolding#4828
mmabrouk merged 3 commits into
big-agentsfrom
chore/agent-remove-load-session

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Jun 24, 2026

Copy link
Copy Markdown
Member

Context

POST /load-session was a shell. It ran over NoopSessionStore and always returned HTTP 200 with an empty message list, so a client could not tell "this session has no history yet" from "session history is not implemented". Durable session storage was never built, which left the route, its request/response models, and the SessionStore port behind it as dead scaffolding that read as a real, working contract.

We decided to remove it rather than keep faking the contract.

Changes

Removed the endpoint and everything that existed only to serve it.

  • adapters/vercel/routing.py: deleted the /load-session route and make_load_session_endpoint, and dropped the session_store parameter from register_agent_message_routes. /messages is untouched.
  • models/workflows.py: deleted LoadSessionRequest and LoadSessionResponse.
  • agents/interfaces.py: deleted the SessionStore and NoopSessionStore ports, plus their top-level re-exports in agents/__init__.py.
  • decorators/routing.py: dropped "load-session" from _RESERVED_PATHS.

The runtime stays cold: the client sends the full conversation on every turn, and /messages still validates, mints, and echoes the session_id (it never touched a store).

SessionStore decision

Removed the port entirely. A grep across sdks/python/agenta/ and services/oss/src/ showed SessionStore / NoopSessionStore / save_turn had exactly one caller: the /load-session route. The /messages session-id path works on the id string alone and never reads or writes a store, and nothing calls save_turn. With the route gone, the port is dead, so it goes too. When durable history is built, it will get a fresh port plus a write path and a real load endpoint.

Docs in the same change

  • Deleted interfaces/public-edge/agent-load-session.md and its bullet in public-edge/README.md.
  • Removed the /load-session row and section from documentation/protocol.md and the SessionStore material from documentation/ports-and-adapters.md.
  • Removed the load-session footnote and the SessionStore status from the interface inventory (interfaces/README.md index row, runtime-ports.md, browser-protocol-adapter.md).
  • Updated ground-truth.md, architecture.md, sessions.md, the agent-workflows README.md, and the OpenCode research note to describe the runtime as cold with no durable store and no history-load endpoint.

Scope / risk

/messages is not touched. The cold-session contract (caller sends full conversation on each turn) is unchanged. The only thing removed is dead code and the scaffolding built for a never-implemented feature. Any code that was importing SessionStore or NoopSessionStore from the SDK will break at import time after this PR; a grep confirmed no such caller exists outside the deleted route.

Tests / notes

  • Removed the two /load-session tests in test_messages_endpoint.py and the /load-session assertions and reserved-path cases in test_routing.py.
  • SDK agents + utils suite: 624 passed, 2 skipped (Daytona-only, unrelated). Service agent unit: 29 passed. ruff format and ruff check clean on every touched file.
  • Stacked on docs/agent-workflow-interface-inventory ([docs] Add agent workflow interface inventory #4821): that lane first-committed the interface inventory pages and protocol.md / ports-and-adapters.md, so this PR is based on it and should merge after it.

How to QA

Prerequisites: Local dev stack (docker compose up or run.sh). The agent service must be running (services/oss/ + the SDK installed).

Steps:

  1. Confirm POST /load-session returns 404, not 200:
    curl -X POST http://localhost:8000/load-session \
      -H "Content-Type: application/json" \
      -d '{"session_id": "test"}' -v
  2. Confirm POST /messages still works (not affected):
    curl -X POST http://localhost:8000/messages \
      -H "Content-Type: application/json" \
      -d '{"messages": [], "session_id": "test-session"}' -v
  3. Confirm the Python SDK no longer exports SessionStore or NoopSessionStore:
    python -c "from agenta.sdk.agents import SessionStore"
    # Expected: ImportError

Expected result: Step 1 returns 404. Step 2 returns 200 with a valid session echo. Step 3 raises ImportError.

Automated tests:

cd sdks/python && uv run python -m pytest oss/tests/pytest/utils/test_messages_endpoint.py oss/tests/pytest/utils/test_routing.py -n0 -v

Edge cases: Confirm no existing agent app that imports from agenta.sdk.agents breaks. The import surface changed; verify from agenta import Agent still works cleanly.

https://claude.ai/code/session_01GYo3UEfvsZpncagqb28Mbc

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 24, 2026
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jun 24, 2026 8:19pm

Request Review

@dosubot dosubot Bot added the refactoring A code change that neither fixes a bug nor adds a feature label Jun 24, 2026
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR removes the /load-session endpoint and the SessionStore/NoopSessionStore surface from the Python SDK, narrows agent routing to /messages, and updates the agent-workflows documentation and tests to describe a cold runtime with no persisted session history.

Changes

Load-session surface removal

Layer / File(s) Summary
Docs and coordination updates
docs/design/agent-workflows/README.md, docs/design/agent-workflows/documentation/*, docs/design/agent-workflows/interfaces/*, docs/design/agent-workflows/projects/research/opencode-architecture.md, docs/design/agent-workflows/scratch/agent-coordination.md
Design docs, interface pages, and coordination notes are updated to describe only /messages, a cold runtime, and the absence of persisted session history.
SDK public surface removal
sdks/python/agenta/sdk/agents/interfaces.py, sdks/python/agenta/sdk/models/workflows.py, sdks/python/agenta/sdk/agents/__init__.py
SessionStore, NoopSessionStore, and /load-session request/response models are removed from the SDK public surface and exports.
Routing and path validation
sdks/python/agenta/sdk/agents/adapters/vercel/routing.py, sdks/python/agenta/sdk/decorators/routing.py, services/oss/src/agent/app.py
Vercel agent routing and shared path validation now register only /messages and no longer build or expose /load-session.
Route and endpoint tests
sdks/python/oss/tests/pytest/utils/test_messages_endpoint.py, sdks/python/oss/tests/pytest/utils/test_routing.py
Tests now cover only /messages endpoint behavior and agent-route path expectations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Agenta-AI/agenta#4771 — Introduced the /load-session surface and SessionStore-based session-history plumbing that this PR removes.
  • Agenta-AI/agenta#4779 — Touched the same docs/design/agent-workflows documentation set around protocol, sessions, and ground truth.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 60.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing the /load-session endpoint and related session-store scaffolding.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description clearly matches the changeset, explaining the removal of /load-session, SessionStore scaffolding, and related docs/tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/agent-remove-load-session

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

mmabrouk added 3 commits June 24, 2026 21:29
…e scaffolding

/load-session was a shell over NoopSessionStore that always returned HTTP 200
with an empty message list. That lies to clients: an empty conversation reads
as "no history yet", not "history is not implemented". Durable session storage
was never built, so the route, its request/response models, and the SessionStore
port behind it were all dead scaffolding.

Remove:
- the /load-session route and make_load_session_endpoint helper, and drop the
  session_store parameter from register_agent_message_routes (keep /messages)
- LoadSessionRequest / LoadSessionResponse models
- the SessionStore and NoopSessionStore ports (used only by /load-session; the
  /messages session-id path validates and echoes the id and never touches a
  store, and nothing calls save_turn) and their top-level re-exports
- "load-session" from the reserved agent paths

The runtime stays cold: the client sends full history on every turn.

Claude-Session: https://claude.ai/code/session_01GYo3UEfvsZpncagqb28Mbc
Keep the docs in sync with the code removal in the same change. Delete the
public-edge/agent-load-session.md page and its README bullet, remove the
/load-session row and section from documentation/protocol.md, the SessionStore
section/entries from ports-and-adapters.md, and the load-session footnote +
SessionStore status from the interfaces inventory (README index row,
runtime-ports, browser-protocol-adapter). Update ground-truth, architecture,
sessions, the agent-workflows README, and the opencode research note to describe
the runtime as cold with no durable store and no history-load endpoint.

Claude-Session: https://claude.ai/code/session_01GYo3UEfvsZpncagqb28Mbc
Add the lane row, record the SessionStore-removal decision and the stacking on
the interface-inventory lane, and release the BUT-LOCK.

Claude-Session: https://claude.ai/code/session_01GYo3UEfvsZpncagqb28Mbc
@mmabrouk mmabrouk force-pushed the docs/agent-workflow-interface-inventory branch from 5dd60f4 to 90930b9 Compare June 24, 2026 20:18
@mmabrouk mmabrouk force-pushed the chore/agent-remove-load-session branch from 2ee7422 to 8d40cff Compare June 24, 2026 20:18
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-06-25T10:54:51.765Z

@mmabrouk

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
sdks/python/oss/tests/pytest/utils/test_routing.py (1)

140-172: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert that /load-session is gone from the agent OpenAPI.

These tests only prove /messages is present. If /load-session were still registered, they would still pass, so the removal contract is no longer enforced.

Suggested test hardening
         schema = _mounts(app)["/chat"].app.openapi()
         assert "/messages" in schema["paths"]
+        assert "/load-session" not in schema["paths"]
         assert "/invoke" in schema["paths"]  # the base routes are still present
@@
         schema = app.openapi()
         assert "/messages" in schema["paths"]
+        assert "/load-session" not in schema["paths"]

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cac82487-7569-4355-b5ba-6958849bd8ca

📥 Commits

Reviewing files that changed from the base of the PR and between 90930b9 and 8d40cff.

📒 Files selected for processing (21)
  • docs/design/agent-workflows/README.md
  • docs/design/agent-workflows/documentation/architecture.md
  • docs/design/agent-workflows/documentation/ground-truth.md
  • docs/design/agent-workflows/documentation/ports-and-adapters.md
  • docs/design/agent-workflows/documentation/protocol.md
  • docs/design/agent-workflows/documentation/sessions.md
  • docs/design/agent-workflows/interfaces/README.md
  • docs/design/agent-workflows/interfaces/in-service/browser-protocol-adapter.md
  • docs/design/agent-workflows/interfaces/in-service/runtime-ports.md
  • docs/design/agent-workflows/interfaces/public-edge/README.md
  • docs/design/agent-workflows/interfaces/public-edge/agent-load-session.md
  • docs/design/agent-workflows/projects/research/opencode-architecture.md
  • docs/design/agent-workflows/scratch/agent-coordination.md
  • sdks/python/agenta/sdk/agents/__init__.py
  • sdks/python/agenta/sdk/agents/adapters/vercel/routing.py
  • sdks/python/agenta/sdk/agents/interfaces.py
  • sdks/python/agenta/sdk/decorators/routing.py
  • sdks/python/agenta/sdk/models/workflows.py
  • sdks/python/oss/tests/pytest/utils/test_messages_endpoint.py
  • sdks/python/oss/tests/pytest/utils/test_routing.py
  • services/oss/src/agent/app.py
💤 Files with no reviewable changes (5)
  • docs/design/agent-workflows/interfaces/public-edge/README.md
  • docs/design/agent-workflows/interfaces/public-edge/agent-load-session.md
  • sdks/python/agenta/sdk/agents/interfaces.py
  • sdks/python/agenta/sdk/models/workflows.py
  • sdks/python/agenta/sdk/agents/init.py

## Verification Pointers

- `/messages` and `/load-session` routing tests live in
- `/messages` routing tests live in

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Include the route-registration test here too.

sdks/python/oss/tests/pytest/utils/test_messages_endpoint.py covers the endpoint flow, but sdks/python/oss/tests/pytest/utils/test_routing.py also asserts /messages in the OpenAPI schema. Listing both keeps the verification path complete. As per the provided test snippets, test_routing.py still guards /messages registration.

Suggested edit
-- `/messages` routing tests live in
-  `sdks/python/oss/tests/pytest/utils/test_messages_endpoint.py`.
+- `/messages` routing tests live in
+  `sdks/python/oss/tests/pytest/utils/test_messages_endpoint.py`
+  and `sdks/python/oss/tests/pytest/utils/test_routing.py`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- `/messages` routing tests live in
- `/messages` routing tests live in
`sdks/python/oss/tests/pytest/utils/test_messages_endpoint.py`
and `sdks/python/oss/tests/pytest/utils/test_routing.py`.

Comment on lines 234 to 241
class TestReservedAgentPaths:
def test_agent_endpoint_names_are_reserved(self):
assert {"messages", "load-session"} <= _RESERVED_PATHS
assert {"messages"} <= _RESERVED_PATHS

@pytest.mark.parametrize("reserved", ["messages", "load-session"])
@pytest.mark.parametrize("reserved", ["messages"])
def test_route_rejects_reserved_agent_path(self, reserved):
with pytest.raises(ValueError, match=reserved):
route(f"/{reserved}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Check that load-session is no longer reserved.

Line 236 now checks only a subset, so this still passes if "load-session" accidentally remains in _RESERVED_PATHS.

Suggested test hardening
 class TestReservedAgentPaths:
     def test_agent_endpoint_names_are_reserved(self):
         assert {"messages"} <= _RESERVED_PATHS
+        assert "load-session" not in _RESERVED_PATHS
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
class TestReservedAgentPaths:
def test_agent_endpoint_names_are_reserved(self):
assert {"messages", "load-session"} <= _RESERVED_PATHS
assert {"messages"} <= _RESERVED_PATHS
@pytest.mark.parametrize("reserved", ["messages", "load-session"])
@pytest.mark.parametrize("reserved", ["messages"])
def test_route_rejects_reserved_agent_path(self, reserved):
with pytest.raises(ValueError, match=reserved):
route(f"/{reserved}")
class TestReservedAgentPaths:
def test_agent_endpoint_names_are_reserved(self):
assert {"messages"} <= _RESERVED_PATHS
assert "load-session" not in _RESERVED_PATHS
`@pytest.mark.parametrize`("reserved", ["messages"])
def test_route_rejects_reserved_agent_path(self, reserved):
with pytest.raises(ValueError, match=reserved):
route(f"/{reserved}")

@mmabrouk mmabrouk added the lgtm This PR has been approved by a maintainer label Jun 25, 2026

@mmabrouk mmabrouk left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mmabrouk mmabrouk changed the base branch from docs/agent-workflow-interface-inventory to big-agents June 25, 2026 10:54
@mmabrouk mmabrouk merged commit e7593af into big-agents Jun 25, 2026
53 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactoring A code change that neither fixes a bug nor adds a feature size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant