Repository navigation
feat(website): a session cookie per site, /go?sid=, the clock's rate, conformance levels and models= (FD-4683) - #444
Open
williamloo-scale wants to merge 4 commits into
Conversation
williamloo-scale
marked this pull request as ready for review
November 3, 2026 00:24
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
williamloo-scale
force-pushed
the
wloo/website-gateway-auth
branch
from
November 3, 2026 21:50
8dcebd1 to
4c1fcc1
Compare
williamloo-scale
force-pushed
the
wloo/website-sdk-followups
branch
from
November 3, 2026 21:50
8090f3e to
2d64812
Compare
williamloo-scale
force-pushed
the
wloo/website-gateway-auth
branch
from
November 3, 2026 22:52
4c1fcc1 to
22947c3
Compare
williamloo-scale
force-pushed
the
wloo/website-sdk-followups
branch
2 times, most recently
from
November 3, 2026 23:47
0ef31b9 to
615d6a0
Compare
williamloo-scale
force-pushed
the
wloo/website-gateway-auth
branch
from
November 3, 2026 23:47
22947c3 to
253eaec
Compare
… conformance levels and models= (FD-4683) This PR's change, rebased as one commit onto #443. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… so its own export loads back (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…rents first, so its export loads back (FD-4683) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…dels= sites; data/get alone (FD-4683) - The store keeps no sessions: no `?sid=`, no `agentenv_sid_<name>` cookie, no `changed_sessions`; `self.store` is the site's one store, which the data plane loads, exports and resets. - A models= site keeps no initial state and no diff; its data plane is its database's. - Conformance runs the round trip with no skip for changed state or sessions. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale
force-pushed
the
wloo/website-sdk-followups
branch
from
November 4, 2026 03:37
718dbb1 to
65a1c8e
Compare
williamloo-scale
force-pushed
the
wloo/website-gateway-auth
branch
from
November 4, 2026 03:37
253eaec to
18b1b98
Compare
Comment on lines
+176
to
+180
| value = parsed.get(column.name) | ||
| if isinstance(value, str): | ||
| kind = _python_type(column) | ||
| if kind in _PARSERS: | ||
| parsed[column.name] = _PARSERS[kind](value.replace("Z", "+00:00") if kind is datetime.datetime else value) |
There was a problem hiding this comment.
Tables.export() turns Python enum members into their values, but _row() does not turn them back into members. SQLAlchemy's Enum(State) stores member names by default. For a member such as OPEN = "open", the export contains "open" while PostgreSQL expects "OPEN".
Restoring that export fails. The conformance check calls data/reset first, so it can leave the site's tables empty. Convert exported enum values back to the column's enum members before inserting.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/agentenv-protocol/src/agentenv_protocol/website/database.py
Line: 176-180
Comment:
**Enum rows fail to restore**
`Tables.export()` turns Python enum members into their values, but `_row()` does not turn them back into members. SQLAlchemy's `Enum(State)` stores member names by default. For a member such as `OPEN = "open"`, the export contains `"open"` while PostgreSQL expects `"OPEN"`.
Restoring that export fails. The conformance check calls `data/reset` first, so it can leave the site's tables empty. Convert exported enum values back to the column's enum members before inserting.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #443.
Website SDK follow-ups.
agentenv_session_<name>, named on the card, so two sites under one gateway host don't overwrite each other's. The sharedagentenv_sessionis still read for one release./go?sid=. Each sid is a store of its own started from the seed, the CUA-Gym convention the website state verifier reads. A request runs in its?sid=, else the one its browser last named (<cookie>_sid), else the default session, which is the data plane's state as before./clock/timealso answersvirtual_seconds_per_real_second, whichUniverseClockfollows instead of inferring it.X-Universe-Now, clock, forwarded headers and cookies warn;--strictfails on a warning.@website(models=...). An object with load/export/reset, or SQLAlchemy models. With models the site getsself.dbonDATABASE_URL, and the data plane and/goread those tables, so the GUI and the MCP tools share rows.Before merging
models=adds an optionaldbextra (sqlalchemy>=2.0), included indev, and updatesuv.lock. SQLAlchemy is imported only when a site uses models.Test
Unit suite: 12,625 passed; the
models=tests (6) also pass with SQLAlchemy installed.🤖 Generated with Claude Code
Fix enum restores before merging; the conformance check can otherwise leave populated tables empty.
Fix with agent prompt
Summary
Adds per-site login cookies, an explicit clock rate, required versus recommended conformance checks, and database-backed websites through
models=.Reviews (13) · Last reviewed commit: "refactor(website): no /go?sid= sessions ..." · Reviewed by Greptile