
Now that we've established a proper eval in tree, this PR is reboots of our agent loop back to a set of minimal tools and simpler prompts. We should aim to get this branch feeling subjectively competitive with what's on main and then merge it, and build from there. Let's invest in our eval and use it to drive better performance of the agent loop. How you can help: Pick an example, and then make the outcome faster or better. It's fine to even use your own subjective judgment, as our evaluation criteria likely need tuning as well at this point. Focus on making the agent work better in your own subjective experience first. Let's focus on simple/practical improvements to make this thing work better, then determine how we can craft our judgment criteria to lock those improvements in. Release Notes: - N/A --------- Co-authored-by: Max <max@zed.dev> Co-authored-by: Antonio <antonio@zed.dev> Co-authored-by: Agus <agus@zed.dev> Co-authored-by: Richard <richard@zed.dev> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-authored-by: Antonio Scandurra <me@as-cii.com> Co-authored-by: Michael Sloan <mgsloan@gmail.com>
2.4 KiB
2.4 KiB
- Add a new test case in
create-client.test.ts
for when thereturnTo
option is provided during sign-out. It verifies that the sign-out URL includes the correctreturn_to
query parameter with the provided URL. The test sets up a mock client, calls signOut with a returnTo value, and asserts that the resulting URL contains the expected session_id and return_to parameters while maintaining the correct API endpoint structure. - Modifies the
signOut
method increate-client.ts
to accept an optional options parameter containing a returnTo string. Instead of directly passing the sessionId to getLogoutUrl, it now passes an object containing both the sessionId and the returnTo value from the options. The method maintains its existing behavior of checking for an access token and clearing session data when a URL is available. - Updates the HTTP client tests in
http-client.test.ts
to reflect the new getLogoutUrl signature. It adds a test case for the basic logout URL and a new describe block for when returnTo is provided, verifying that the URL includes the properly encoded return_to parameter. The test ensures the URL construction handles both cases correctly. - Modifies the
getLogoutUrl
method inhttp-client.ts
to accept an object parameter with sessionId and returnTo properties instead of just a sessionId string. It maintains the base URL construction but now conditionally adds the return_to query parameter only when a returnTo value is provided, while always including the session_id parameter. The method handles URL construction and parameter encoding internally. - Updates the session initialization logic in
create-client.ts
to check for either aworkos-has-session
cookie or a refresh token (retrieved viagetRefreshToken
). This allows the client to refresh sessions even if nocode
is present in the URL, especially in development environments. - Adds corresponding test coverage in
create-client.test.ts
:- When no code is in the URL but the
workos-has-session
cookie exists, the session should be refreshed. - When devMode is enabled and a refresh token is present in localStorage, the session should be refreshed.
- When devMode is enabled but no refresh token exists, the client should be created without making any network requests.
- When neither a code, cookie, nor refresh token is present, the client should initialize without refreshing.
- When no code is in the URL but the