Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Patch instructions and canonical name #1057

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Conversation

whiterabbit1983
Copy link
Contributor

@whiterabbit1983 whiterabbit1983 commented Jan 14, 2025

PR Type

Bug fix, Enhancement


Description

  • Added support for patching instructions and canonical_name in the patch_agent query.

  • Enhanced SQL query to handle new fields conditionally.

  • Updated function to process and pass new fields correctly.


Changes walkthrough 📝

Relevant files
Enhancement
patch_agent.py
Support patching instructions and canonical name                 

agents-api/agents_api/queries/agents/patch_agent.py

  • Added conditional handling for instructions and canonical_name in SQL
    query.
  • Updated function to process instructions as a list or string.
  • Enhanced query parameters to include new fields.
  • +10/-0   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information


    Important

    Enhance patch_agent to support patching instructions and canonical_name with updated SQL handling.

    • Enhancements in patch_agent.py:
      • Added support for patching instructions and canonical_name in the patch_agent function.
      • Updated SQL query to conditionally handle instructions as a list or string and canonical_name.
      • Modified parameters to include new fields instructions and canonical_name.

    This description was created by Ellipsis for 0aa9621. It will automatically update as commits are pushed.

    Copy link
    Contributor

    @ellipsis-dev ellipsis-dev bot left a comment

    Choose a reason for hiding this comment

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

    👍 Looks good to me! Reviewed everything up to 2a393e3 in 11 seconds

    More details
    • Looked at 28 lines of code in 1 files
    • Skipped 0 files when reviewing.
    • Skipped posting 1 drafted comments based on config settings.
    1. agents-api/agents_api/queries/agents/patch_agent.py:83
    • Draft comment:
      Ensure data.instructions is consistently a list before passing it to the SQL query. Consider handling cases where data.instructions might be None or another type.
    • Reason this comment was not posted:
      Comment did not seem useful.

    Workflow ID: wflow_OivbCQQPxVZEPF8e


    You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 Security concerns

    SQL Injection:
    The query uses parameterized inputs which is good practice, but the metadata and default_settings are passed as jsonb without apparent validation of their content. This could potentially allow injection of malicious JSON structures if not properly sanitized before reaching this function.

    ⚡ Recommended focus areas for review

    Data Validation

    The instructions field is converted to a single-item list when it's a string, but there's no validation for empty lists or None values which could cause issues

    [data.instructions] if isinstance(data.instructions, str) else data.instructions,
    SQL Parameter

    The SQL query references parameters $8 and $9 but there's no validation that all previous parameters ($1-$7) are properly handled and passed

    		WHEN $8::text[] IS NOT NULL THEN $8
    		ELSE instructions
    	END,
        canonical_name = CASE
            WHEN $9::citext IS NOT NULL THEN $9
            ELSE canonical_name

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Add defensive type checking for input parameters to prevent runtime errors

    Add type checking for instructions before converting to list to avoid potential
    runtime errors. Verify that instructions is either a string, list, or None.

    agents-api/agents_api/queries/agents/patch_agent.py [83]

    -[data.instructions] if isinstance(data.instructions, str) else data.instructions,
    +[data.instructions] if isinstance(data.instructions, str) else (data.instructions if isinstance(data.instructions, (list, type(None))) else None),
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The suggestion adds crucial type validation to prevent potential runtime errors by ensuring 'instructions' is of valid type (string, list, or None) before processing. This is important for maintaining data integrity and preventing application crashes.

    8

    Copy link
    Contributor

    qodo-merge-pro-for-open-source bot commented Jan 14, 2025

    CI Failure Feedback 🧐

    (Checks updated until commit 0aa9621)

    Action: Test

    Failed stage: Run tests [❌]

    Failed test name: test_agent_routes

    Failure summary:

    The action failed due to a database connection pool configuration error. Specifically:

  • The database pool's min_size (10) was set larger than max_size (4), which is invalid
  • This caused the test fixture 'client' to fail to initialize
  • As a result, 3 tests in test_agent_routes.py failed:
    * route: unauthorized should fail
    * route:
    create agent
    * route: create agent with instructions

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    1328:  PASS  test_agent_queries:28 query: create agent sql                          1%
    1329:  PASS  test_agent_queries:44 query: create or update agent sql                2%
    1330:  PASS  test_agent_queries:63 query: update agent sql                          2%
    1331:  PASS  test_agent_queries:85 query: get agent not exists sql                  3%
    1332:  PASS  test_agent_queries:96 query: get agent exists sql                      3%
    1333:  PASS  test_agent_queries:111 query: list agents sql                          4%
    1334:  PASS  test_agent_queries:122 query: patch agent sql                          4%
    1335:  PASS  test_agent_queries:143 query: delete agent sql                         5%
    1336:  FAIL  test_agent_routes:9 route: unauthorized should fail                    6%
    1337:  FAIL  test_agent_routes:26 route: create agent                               6%
    1338:  FAIL  test_agent_routes:43 route: create agent with instructions             7%
    1339:  ─────────────────────── route: unauthorized should fail ────────────────────────
    1340:  Failed at tests/test_agent_routes.py                                          
    ...
    
    1461:  │ │              name = '_dsn'                                           │ │  
    1462:  │ │              self = TestArgumentResolver(                            │ │  
    1463:  │ │                     │   test=Test(                                   │ │  
    1464:  │ │                     │   │   fn=<function _ at 0x7f676950ec00>,       │ │  
    1465:  │ │                     │   │   module_name='test_agent_routes',         │ │  
    1466:  │ │                     │   │   id='5d1141e9b4a847c4954e2382db50fda2',   │ │  
    1467:  │ │                     │   │   marker=None,                             │ │  
    1468:  │ │                     │   │   description='route: unauthorized should  │ │  
    1469:  │ │                     fail',                                           │ │  
    ...
    
    1588:  │ │ self = <anyio._backends._asyncio.BlockingPortal object at            │ │  
    1589:  │ │        0x7f676939ebd0>                                               │ │  
    1590:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    1591:  │                                                                          │  
    1592:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    1593:  │ python3.12/concurrent/futures/_base.py:456 in result                     │  
    1594:  │                                                                          │  
    1595:  │   453 │   │   │   │   if self._state in [CANCELLED, CANCELLED_AND_NOTIFI │  
    1596:  │   454 │   │   │   │   │   raise CancelledError()                         │  
    1597:  │   455 │   │   │   │   elif self._state == FINISHED:                      │  
    1598:  │ ❱ 456 │   │   │   │   │   return self.__get_result()                     │  
    1599:  │   457 │   │   │   │   else:                                              │  
    1600:  │   458 │   │   │   │   │   raise TimeoutError()                           │  
    ...
    
    1632:  │   221 │   │   except self._cancelled_exc_class:                          │  
    1633:  │                                                                          │  
    1634:  │ ╭─────────────────────────────── locals ───────────────────────────────╮ │  
    1635:  │ │                args = ()                                             │ │  
    1636:  │ │                func = <bound method TestClient.wait_startup of       │ │  
    1637:  │ │                       <starlette.testclient.TestClient object at     │ │  
    1638:  │ │                       0x7f67693b2510>>                               │ │  
    1639:  │ │              future = <Future at 0x7f676939d220 state=finished       │ │  
    1640:  │ │                       raised ValueError>                             │ │  
    ...
    
    1644:  │ │               scope = None                                           │ │  
    1645:  │ │                self = <anyio._backends._asyncio.BlockingPortal       │ │  
    1646:  │ │                       object at 0x7f676939ebd0>                      │ │  
    1647:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    1648:  │                                                                          │  
    1649:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
    1650:  │ ges/starlette/testclient.py:774 in wait_startup                          │  
    1651:  │                                                                          │  
    1652:  │   771 │   │   │   "lifespan.startup.failed",                             │  
    1653:  │   772 │   │   )                                                          │  
    1654:  │   773 │   │   if message["type"] == "lifespan.startup.failed":           │  
    1655:  │ ❱ 774 │   │   │   await receive()                                        │  
    1656:  │   775 │                                                                  │  
    1657:  │   776 │   async def wait_shutdown(self) -> None:                         │  
    1658:  │   777 │   │   async def receive() -> typing.Any:                         │  
    1659:  │                                                                          │  
    1660:  │ ╭─────────────────────────────── locals ───────────────────────────────╮ │  
    1661:  │ │ message = {                                                          │ │  
    1662:  │ │           │   'type': 'lifespan.startup.failed',                     │ │  
    ...
    
    1681:  │ │ message = None                                                       │ │  
    1682:  │ │    self = <starlette.testclient.TestClient object at 0x7f67693b2510> │ │  
    1683:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    1684:  │                                                                          │  
    1685:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    1686:  │ python3.12/concurrent/futures/_base.py:449 in result                     │  
    1687:  │                                                                          │  
    1688:  │   446 │   │   │   │   if self._state in [CANCELLED, CANCELLED_AND_NOTIFI │  
    1689:  │   447 │   │   │   │   │   raise CancelledError()                         │  
    ...
    
    1725:  │   221 │   │   except self._cancelled_exc_class:                          │  
    1726:  │                                                                          │  
    1727:  │ ╭─────────────────────────────── locals ───────────────────────────────╮ │  
    1728:  │ │                args = ()                                             │ │  
    1729:  │ │                func = <bound method TestClient.lifespan of           │ │  
    1730:  │ │                       <starlette.testclient.TestClient object at     │ │  
    1731:  │ │                       0x7f67693b2510>>                               │ │  
    1732:  │ │              future = <Future at 0x7f676939d010 state=finished       │ │  
    1733:  │ │                       raised ValueError>                             │ │  
    ...
    
    1840:  │ │           waiting_senders=OrderedDict()), _closed=False),            │ │  
    1841:  │ │           receive_stream=MemoryObjectReceiveStream(_state=MemoryObj… │ │  
    1842:  │ │           buffer=deque([]), open_send_channels=1,                    │ │  
    1843:  │ │           open_receive_channels=1, waiting_receivers=OrderedDict(),  │ │  
    1844:  │ │           waiting_senders=OrderedDict()), _closed=False))>           │ │  
    1845:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    1846:  │                                                                          │  
    1847:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
    1848:  │ ges/starlette/middleware/errors.py:152 in __call__                       │  
    ...
    
    1868:  │ │   scope = {                                                          │ │  
    1869:  │ │           │   'type': 'lifespan',                                    │ │  
    1870:  │ │           │   'state': {},                                           │ │  
    1871:  │ │           │   'app': <fastapi.applications.FastAPI object at         │ │  
    1872:  │ │           0x7f67848f5bb0>,                                           │ │  
    1873:  │ │           │   'router': <fastapi.routing.APIRouter object at         │ │  
    1874:  │ │           0x7f676ae962a0>                                            │ │  
    1875:  │ │           }                                                          │ │  
    1876:  │ │    self = <starlette.middleware.errors.ServerErrorMiddleware object  │ │  
    ...
    
    2098:  │ ges/starlette/routing.py:693 in lifespan                                 │  
    2099:  │                                                                          │  
    2100:  │   690 │   │   app: typing.Any = scope.get("app")                         │  
    2101:  │   691 │   │   await receive()                                            │  
    2102:  │   692 │   │   try:                                                       │  
    2103:  │ ❱ 693 │   │   │   async with self.lifespan_context(app) as maybe_state:  │  
    2104:  │   694 │   │   │   │   if maybe_state is not None:                        │  
    2105:  │   695 │   │   │   │   │   if "state" not in scope:                       │  
    2106:  │   696 │   │   │   │   │   │   raise RuntimeError('The server does not su │  
    ...
    
    2142:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    2143:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    2144:  │                                                                          │  
    2145:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    2146:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    2147:  │   209 │   │   try:                                                       │  
    2148:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    2149:  │   211 │   │   except StopAsyncIteration:                                 │  
    2150:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    2176:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    2177:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    2178:  │                                                                          │  
    2179:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    2180:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    2181:  │   209 │   │   try:                                                       │  
    2182:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    2183:  │   211 │   │   except StopAsyncIteration:                                 │  
    2184:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    2210:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    2211:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    2212:  │                                                                          │  
    2213:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    2214:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    2215:  │   209 │   │   try:                                                       │  
    2216:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    2217:  │   211 │   │   except StopAsyncIteration:                                 │  
    2218:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    2244:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    2245:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    2246:  │                                                                          │  
    2247:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    2248:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    2249:  │   209 │   │   try:                                                       │  
    2250:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    2251:  │   211 │   │   except StopAsyncIteration:                                 │  
    2252:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    2278:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    2279:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    2280:  │                                                                          │  
    2281:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    2282:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    2283:  │   209 │   │   try:                                                       │  
    2284:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    2285:  │   211 │   │   except StopAsyncIteration:                                 │  
    2286:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    2312:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    2313:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    2314:  │                                                                          │  
    2315:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    2316:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    2317:  │   209 │   │   try:                                                       │  
    2318:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    2319:  │   211 │   │   except StopAsyncIteration:                                 │  
    2320:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    2346:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    2347:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    2348:  │                                                                          │  
    2349:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    2350:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    2351:  │   209 │   │   try:                                                       │  
    2352:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    2353:  │   211 │   │   except StopAsyncIteration:                                 │  
    2354:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    2380:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    2381:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    2382:  │                                                                          │  
    2383:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    2384:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    2385:  │   209 │   │   try:                                                       │  
    2386:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    2387:  │   211 │   │   except StopAsyncIteration:                                 │  
    2388:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    2414:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    2415:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    2416:  │                                                                          │  
    2417:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    2418:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    2419:  │   209 │   │   try:                                                       │  
    2420:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    2421:  │   211 │   │   except StopAsyncIteration:                                 │  
    2422:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    2448:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    2449:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    2450:  │                                                                          │  
    2451:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    2452:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    2453:  │   209 │   │   try:                                                       │  
    2454:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    2455:  │   211 │   │   except StopAsyncIteration:                                 │  
    2456:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    2482:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    2483:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    2484:  │                                                                          │  
    2485:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    2486:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    2487:  │   209 │   │   try:                                                       │  
    2488:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    2489:  │   211 │   │   except StopAsyncIteration:                                 │  
    2490:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    2553:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    2554:  │                                                                          │  
    2555:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
    2556:  │ ges/asyncpg/pool.py:361 in __init__                                      │  
    2557:  │                                                                          │  
    2558:  │    358 │   │   │   │   'min_size is expected to be greater or equal to z │  
    2559:  │    359 │   │                                                             │  
    2560:  │    360 │   │   if min_size > max_size:                                   │  
    2561:  │ ❱  361 │   │   │   raise ValueError('min_size is greater than max_size') │  
    2562:  │    362 │   │                                                             │  
    2563:  │    363 │   │   if max_queries <= 0:                                      │  
    2564:  │    364 │   │   │   raise ValueError('max_queries is expected to be great │  
    ...
    
    2578:  │ │                        max_size = 4                                  │ │  
    2579:  │ │                        min_size = 10                                 │ │  
    2580:  │ │                           reset = None                               │ │  
    2581:  │ │                            self = <asyncpg.pool.Pool object at       │ │  
    2582:  │ │                                   0x7f676931d840>                    │ │  
    2583:  │ │                           setup = None                               │ │  
    2584:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    2585:  ╰──────────────────────────────────────────────────────────────────────────╯  
    2586:  ValueError: min_size is greater than max_size                                 
    ...
    
    2663:  │ │         │   }                                                        │ │  
    2664:  │ │         )                                                            │ │  
    2665:  │ │  self = TestArgumentResolver(                                        │ │  
    2666:  │ │         │   test=Test(                                               │ │  
    2667:  │ │         │   │   fn=<function _ at 0x7f676950ec00>,                   │ │  
    2668:  │ │         │   │   module_name='test_agent_routes',                     │ │  
    2669:  │ │         │   │   id='5d1141e9b4a847c4954e2382db50fda2',               │ │  
    2670:  │ │         │   │   marker=None,                                         │ │  
    2671:  │ │         │   │   description='route: unauthorized should fail',       │ │  
    ...
    
    2790:  │ │      resolved_args = {}                                              │ │  
    2791:  │ │               self = TestArgumentResolver(                           │ │  
    2792:  │ │                      │   test=Test(                                  │ │  
    2793:  │ │                      │   │   fn=<function _ at 0x7f676950ec00>,      │ │  
    2794:  │ │                      │   │   module_name='test_agent_routes',        │ │  
    2795:  │ │                      │   │   id='5d1141e9b4a847c4954e2382db50fda2',  │ │  
    2796:  │ │                      │   │   marker=None,                            │ │  
    2797:  │ │                      │   │   description='route: unauthorized should │ │  
    2798:  │ │                      fail',                                          │ │  
    ...
    
    2823:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    2824:  │                                                                          │  
    2825:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
    2826:  │ ges/ward/testing.py:637 in _resolve_single_arg                           │  
    2827:  │                                                                          │  
    2828:  │   634 │   │   │   else:                                                  │  
    2829:  │   635 │   │   │   │   fixture.resolved_val = arg(**args_to_inject)       │  
    2830:  │   636 │   │   except (Exception, SystemExit) as e:                       │  
    2831:  │ ❱ 637 │   │   │   raise FixtureError(f"Unable to resolve fixture '{fixtu │  
    ...
    
    2944:  │ │              name = '_dsn'                                           │ │  
    2945:  │ │              self = TestArgumentResolver(                            │ │  
    2946:  │ │                     │   test=Test(                                   │ │  
    2947:  │ │                     │   │   fn=<function _ at 0x7f676950ec00>,       │ │  
    2948:  │ │                     │   │   module_name='test_agent_routes',         │ │  
    2949:  │ │                     │   │   id='5d1141e9b4a847c4954e2382db50fda2',   │ │  
    2950:  │ │                     │   │   marker=None,                             │ │  
    2951:  │ │                     │   │   description='route: unauthorized should  │ │  
    2952:  │ │                     fail',                                           │ │  
    ...
    
    2971:  │ │                     │   │   timer=<ward._testing._Timer object at    │ │  
    2972:  │ │                     0x7f67693d9220>,                                 │ │  
    2973:  │ │                     │   │   tags=[]                                  │ │  
    2974:  │ │                     │   ),                                           │ │  
    2975:  │ │                     │   iteration=0                                  │ │  
    2976:  │ │                     )                                                │ │  
    2977:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    2978:  ╰──────────────────────────────────────────────────────────────────────────╯  
    2979:  FixtureError: Unable to resolve fixture 'client'                              
    2980:  ───────────────────────────── route: create agent ──────────────────────────────
    2981:  Failed at tests/test_agent_routes.py                                          
    ...
    
    3228:  │ │ self = <anyio._backends._asyncio.BlockingPortal object at            │ │  
    3229:  │ │        0x7f676939e1b0>                                               │ │  
    3230:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    3231:  │                                                                          │  
    3232:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    3233:  │ python3.12/concurrent/futures/_base.py:456 in result                     │  
    3234:  │                                                                          │  
    3235:  │   453 │   │   │   │   if self._state in [CANCELLED, CANCELLED_AND_NOTIFI │  
    3236:  │   454 │   │   │   │   │   raise CancelledError()                         │  
    3237:  │   455 │   │   │   │   elif self._state == FINISHED:                      │  
    3238:  │ ❱ 456 │   │   │   │   │   return self.__get_result()                     │  
    3239:  │   457 │   │   │   │   else:                                              │  
    3240:  │   458 │   │   │   │   │   raise TimeoutError()                           │  
    ...
    
    3272:  │   221 │   │   except self._cancelled_exc_class:                          │  
    3273:  │                                                                          │  
    3274:  │ ╭─────────────────────────────── locals ───────────────────────────────╮ │  
    3275:  │ │                args = ()                                             │ │  
    3276:  │ │                func = <bound method TestClient.wait_startup of       │ │  
    3277:  │ │                       <starlette.testclient.TestClient object at     │ │  
    3278:  │ │                       0x7f676939f500>>                               │ │  
    3279:  │ │              future = <Future at 0x7f676939d670 state=finished       │ │  
    3280:  │ │                       raised ValueError>                             │ │  
    ...
    
    3284:  │ │               scope = None                                           │ │  
    3285:  │ │                self = <anyio._backends._asyncio.BlockingPortal       │ │  
    3286:  │ │                       object at 0x7f676939e1b0>                      │ │  
    3287:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    3288:  │                                                                          │  
    3289:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
    3290:  │ ges/starlette/testclient.py:774 in wait_startup                          │  
    3291:  │                                                                          │  
    3292:  │   771 │   │   │   "lifespan.startup.failed",                             │  
    3293:  │   772 │   │   )                                                          │  
    3294:  │   773 │   │   if message["type"] == "lifespan.startup.failed":           │  
    3295:  │ ❱ 774 │   │   │   await receive()                                        │  
    3296:  │   775 │                                                                  │  
    3297:  │   776 │   async def wait_shutdown(self) -> None:                         │  
    3298:  │   777 │   │   async def receive() -> typing.Any:                         │  
    3299:  │                                                                          │  
    3300:  │ ╭─────────────────────────────── locals ───────────────────────────────╮ │  
    3301:  │ │ message = {                                                          │ │  
    3302:  │ │           │   'type': 'lifespan.startup.failed',                     │ │  
    ...
    
    3321:  │ │ message = None                                                       │ │  
    3322:  │ │    self = <starlette.testclient.TestClient object at 0x7f676939f500> │ │  
    3323:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    3324:  │                                                                          │  
    3325:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    3326:  │ python3.12/concurrent/futures/_base.py:449 in result                     │  
    3327:  │                                                                          │  
    3328:  │   446 │   │   │   │   if self._state in [CANCELLED, CANCELLED_AND_NOTIFI │  
    3329:  │   447 │   │   │   │   │   raise CancelledError()                         │  
    ...
    
    3365:  │   221 │   │   except self._cancelled_exc_class:                          │  
    3366:  │                                                                          │  
    3367:  │ ╭─────────────────────────────── locals ───────────────────────────────╮ │  
    3368:  │ │                args = ()                                             │ │  
    3369:  │ │                func = <bound method TestClient.lifespan of           │ │  
    3370:  │ │                       <starlette.testclient.TestClient object at     │ │  
    3371:  │ │                       0x7f676939f500>>                               │ │  
    3372:  │ │              future = <Future at 0x7f676939d610 state=finished       │ │  
    3373:  │ │                       raised ValueError>                             │ │  
    ...
    
    3480:  │ │           waiting_senders=OrderedDict()), _closed=False),            │ │  
    3481:  │ │           receive_stream=MemoryObjectReceiveStream(_state=MemoryObj… │ │  
    3482:  │ │           buffer=deque([]), open_send_channels=1,                    │ │  
    3483:  │ │           open_receive_channels=1, waiting_receivers=OrderedDict(),  │ │  
    3484:  │ │           waiting_senders=OrderedDict()), _closed=False))>           │ │  
    3485:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    3486:  │                                                                          │  
    3487:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
    3488:  │ ges/starlette/middleware/errors.py:152 in __call__                       │  
    ...
    
    3508:  │ │   scope = {                                                          │ │  
    3509:  │ │           │   'type': 'lifespan',                                    │ │  
    3510:  │ │           │   'state': {},                                           │ │  
    3511:  │ │           │   'app': <fastapi.applications.FastAPI object at         │ │  
    3512:  │ │           0x7f67848f5bb0>,                                           │ │  
    3513:  │ │           │   'router': <fastapi.routing.APIRouter object at         │ │  
    3514:  │ │           0x7f676ae962a0>                                            │ │  
    3515:  │ │           }                                                          │ │  
    3516:  │ │    self = <starlette.middleware.errors.ServerErrorMiddleware object  │ │  
    ...
    
    3738:  │ ges/starlette/routing.py:693 in lifespan                                 │  
    3739:  │                                                                          │  
    3740:  │   690 │   │   app: typing.Any = scope.get("app")                         │  
    3741:  │   691 │   │   await receive()                                            │  
    3742:  │   692 │   │   try:                                                       │  
    3743:  │ ❱ 693 │   │   │   async with self.lifespan_context(app) as maybe_state:  │  
    3744:  │   694 │   │   │   │   if maybe_state is not None:                        │  
    3745:  │   695 │   │   │   │   │   if "state" not in scope:                       │  
    3746:  │   696 │   │   │   │   │   │   raise RuntimeError('The server does not su │  
    ...
    
    3782:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    3783:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    3784:  │                                                                          │  
    3785:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    3786:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    3787:  │   209 │   │   try:                                                       │  
    3788:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    3789:  │   211 │   │   except StopAsyncIteration:                                 │  
    3790:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    3816:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    3817:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    3818:  │                                                                          │  
    3819:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    3820:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    3821:  │   209 │   │   try:                                                       │  
    3822:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    3823:  │   211 │   │   except StopAsyncIteration:                                 │  
    3824:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    3850:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    3851:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    3852:  │                                                                          │  
    3853:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    3854:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    3855:  │   209 │   │   try:                                                       │  
    3856:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    3857:  │   211 │   │   except StopAsyncIteration:                                 │  
    3858:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    3884:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    3885:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    3886:  │                                                                          │  
    3887:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    3888:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    3889:  │   209 │   │   try:                                                       │  
    3890:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    3891:  │   211 │   │   except StopAsyncIteration:                                 │  
    3892:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    3918:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    3919:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    3920:  │                                                                          │  
    3921:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    3922:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    3923:  │   209 │   │   try:                                                       │  
    3924:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    3925:  │   211 │   │   except StopAsyncIteration:                                 │  
    3926:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    3952:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    3953:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    3954:  │                                                                          │  
    3955:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    3956:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    3957:  │   209 │   │   try:                                                       │  
    3958:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    3959:  │   211 │   │   except StopAsyncIteration:                                 │  
    3960:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    3986:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    3987:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    3988:  │                                                                          │  
    3989:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    3990:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    3991:  │   209 │   │   try:                                                       │  
    3992:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    3993:  │   211 │   │   except StopAsyncIteration:                                 │  
    3994:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    4020:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    4021:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    4022:  │                                                                          │  
    4023:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    4024:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    4025:  │   209 │   │   try:                                                       │  
    4026:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    4027:  │   211 │   │   except StopAsyncIteration:                                 │  
    4028:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    4054:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    4055:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    4056:  │                                                                          │  
    4057:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    4058:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    4059:  │   209 │   │   try:                                                       │  
    4060:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    4061:  │   211 │   │   except StopAsyncIteration:                                 │  
    4062:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    4088:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    4089:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    4090:  │                                                                          │  
    4091:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    4092:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    4093:  │   209 │   │   try:                                                       │  
    4094:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    4095:  │   211 │   │   except StopAsyncIteration:                                 │  
    4096:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    4122:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    4123:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    4124:  │                                                                          │  
    4125:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    4126:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    4127:  │   209 │   │   try:                                                       │  
    4128:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    4129:  │   211 │   │   except StopAsyncIteration:                                 │  
    4130:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    4193:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    4194:  │                                                                          │  
    4195:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
    4196:  │ ges/asyncpg/pool.py:361 in __init__                                      │  
    4197:  │                                                                          │  
    4198:  │    358 │   │   │   │   'min_size is expected to be greater or equal to z │  
    4199:  │    359 │   │                                                             │  
    4200:  │    360 │   │   if min_size > max_size:                                   │  
    4201:  │ ❱  361 │   │   │   raise ValueError('min_size is greater than max_size') │  
    4202:  │    362 │   │                                                             │  
    4203:  │    363 │   │   if max_queries <= 0:                                      │  
    4204:  │    364 │   │   │   raise ValueError('max_queries is expected to be great │  
    ...
    
    4218:  │ │                        max_size = 4                                  │ │  
    4219:  │ │                        min_size = 10                                 │ │  
    4220:  │ │                           reset = None                               │ │  
    4221:  │ │                            self = <asyncpg.pool.Pool object at       │ │  
    4222:  │ │                                   0x7f676931e080>                    │ │  
    4223:  │ │                           setup = None                               │ │  
    4224:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    4225:  ╰──────────────────────────────────────────────────────────────────────────╯  
    4226:  ValueError: min_size is greater than max_size                                 
    ...
    
    4604:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    4605:  │                                                                          │  
    4606:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
    4607:  │ ges/ward/testing.py:637 in _resolve_single_arg                           │  
    4608:  │                                                                          │  
    4609:  │   634 │   │   │   else:                                                  │  
    4610:  │   635 │   │   │   │   fixture.resolved_val = arg(**args_to_inject)       │  
    4611:  │   636 │   │   except (Exception, SystemExit) as e:                       │  
    4612:  │ ❱ 637 │   │   │   raise FixtureError(f"Unable to resolve fixture '{fixtu │  
    ...
    
    4751:  │ │                     │   │   timer=<ward._testing._Timer object at    │ │  
    4752:  │ │                     0x7f676939df40>,                                 │ │  
    4753:  │ │                     │   │   tags=[]                                  │ │  
    4754:  │ │                     │   ),                                           │ │  
    4755:  │ │                     │   iteration=0                                  │ │  
    4756:  │ │                     )                                                │ │  
    4757:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    4758:  ╰──────────────────────────────────────────────────────────────────────────╯  
    4759:  FixtureError: Unable to resolve fixture 'client'                              
    4760:  ──────────────────── route: create agent with instructions ─────────────────────
    4761:  Failed at tests/test_agent_routes.py                                          
    ...
    
    5009:  │ │ self = <anyio._backends._asyncio.BlockingPortal object at            │ │  
    5010:  │ │        0x7f67693913a0>                                               │ │  
    5011:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    5012:  │                                                                          │  
    5013:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5014:  │ python3.12/concurrent/futures/_base.py:456 in result                     │  
    5015:  │                                                                          │  
    5016:  │   453 │   │   │   │   if self._state in [CANCELLED, CANCELLED_AND_NOTIFI │  
    5017:  │   454 │   │   │   │   │   raise CancelledError()                         │  
    5018:  │   455 │   │   │   │   elif self._state == FINISHED:                      │  
    5019:  │ ❱ 456 │   │   │   │   │   return self.__get_result()                     │  
    5020:  │   457 │   │   │   │   else:                                              │  
    5021:  │   458 │   │   │   │   │   raise TimeoutError()                           │  
    ...
    
    5053:  │   221 │   │   except self._cancelled_exc_class:                          │  
    5054:  │                                                                          │  
    5055:  │ ╭─────────────────────────────── locals ───────────────────────────────╮ │  
    5056:  │ │                args = ()                                             │ │  
    5057:  │ │                func = <bound method TestClient.wait_startup of       │ │  
    5058:  │ │                       <starlette.testclient.TestClient object at     │ │  
    5059:  │ │                       0x7f676939cec0>>                               │ │  
    5060:  │ │              future = <Future at 0x7f67693925d0 state=finished       │ │  
    5061:  │ │                       raised ValueError>                             │ │  
    ...
    
    5065:  │ │               scope = None                                           │ │  
    5066:  │ │                self = <anyio._backends._asyncio.BlockingPortal       │ │  
    5067:  │ │                       object at 0x7f67693913a0>                      │ │  
    5068:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    5069:  │                                                                          │  
    5070:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
    5071:  │ ges/starlette/testclient.py:774 in wait_startup                          │  
    5072:  │                                                                          │  
    5073:  │   771 │   │   │   "lifespan.startup.failed",                             │  
    5074:  │   772 │   │   )                                                          │  
    5075:  │   773 │   │   if message["type"] == "lifespan.startup.failed":           │  
    5076:  │ ❱ 774 │   │   │   await receive()                                        │  
    5077:  │   775 │                                                                  │  
    5078:  │   776 │   async def wait_shutdown(self) -> None:                         │  
    5079:  │   777 │   │   async def receive() -> typing.Any:                         │  
    5080:  │                                                                          │  
    5081:  │ ╭─────────────────────────────── locals ───────────────────────────────╮ │  
    5082:  │ │ message = {                                                          │ │  
    5083:  │ │           │   'type': 'lifespan.startup.failed',                     │ │  
    ...
    
    5102:  │ │ message = None                                                       │ │  
    5103:  │ │    self = <starlette.testclient.TestClient object at 0x7f676939cec0> │ │  
    5104:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    5105:  │                                                                          │  
    5106:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5107:  │ python3.12/concurrent/futures/_base.py:449 in result                     │  
    5108:  │                                                                          │  
    5109:  │   446 │   │   │   │   if self._state in [CANCELLED, CANCELLED_AND_NOTIFI │  
    5110:  │   447 │   │   │   │   │   raise CancelledError()                         │  
    ...
    
    5146:  │   221 │   │   except self._cancelled_exc_class:                          │  
    5147:  │                                                                          │  
    5148:  │ ╭─────────────────────────────── locals ───────────────────────────────╮ │  
    5149:  │ │                args = ()                                             │ │  
    5150:  │ │                func = <bound method TestClient.lifespan of           │ │  
    5151:  │ │                       <starlette.testclient.TestClient object at     │ │  
    5152:  │ │                       0x7f676939cec0>>                               │ │  
    5153:  │ │              future = <Future at 0x7f6769392630 state=finished       │ │  
    5154:  │ │                       raised ValueError>                             │ │  
    ...
    
    5261:  │ │           waiting_senders=OrderedDict()), _closed=False),            │ │  
    5262:  │ │           receive_stream=MemoryObjectReceiveStream(_state=MemoryObj… │ │  
    5263:  │ │           buffer=deque([]), open_send_channels=1,                    │ │  
    5264:  │ │           open_receive_channels=1, waiting_receivers=OrderedDict(),  │ │  
    5265:  │ │           waiting_senders=OrderedDict()), _closed=False))>           │ │  
    5266:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    5267:  │                                                                          │  
    5268:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
    5269:  │ ges/starlette/middleware/errors.py:152 in __call__                       │  
    ...
    
    5289:  │ │   scope = {                                                          │ │  
    5290:  │ │           │   'type': 'lifespan',                                    │ │  
    5291:  │ │           │   'state': {},                                           │ │  
    5292:  │ │           │   'app': <fastapi.applications.FastAPI object at         │ │  
    5293:  │ │           0x7f67848f5bb0>,                                           │ │  
    5294:  │ │           │   'router': <fastapi.routing.APIRouter object at         │ │  
    5295:  │ │           0x7f676ae962a0>                                            │ │  
    5296:  │ │           }                                                          │ │  
    5297:  │ │    self = <starlette.middleware.errors.ServerErrorMiddleware object  │ │  
    ...
    
    5519:  │ ges/starlette/routing.py:693 in lifespan                                 │  
    5520:  │                                                                          │  
    5521:  │   690 │   │   app: typing.Any = scope.get("app")                         │  
    5522:  │   691 │   │   await receive()                                            │  
    5523:  │   692 │   │   try:                                                       │  
    5524:  │ ❱ 693 │   │   │   async with self.lifespan_context(app) as maybe_state:  │  
    5525:  │   694 │   │   │   │   if maybe_state is not None:                        │  
    5526:  │   695 │   │   │   │   │   if "state" not in scope:                       │  
    5527:  │   696 │   │   │   │   │   │   raise RuntimeError('The server does not su │  
    ...
    
    5563:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5564:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    5565:  │                                                                          │  
    5566:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    5567:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    5568:  │   209 │   │   try:                                                       │  
    5569:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    5570:  │   211 │   │   except StopAsyncIteration:                                 │  
    5571:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    5597:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5598:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    5599:  │                                                                          │  
    5600:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    5601:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    5602:  │   209 │   │   try:                                                       │  
    5603:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    5604:  │   211 │   │   except StopAsyncIteration:                                 │  
    5605:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    5631:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5632:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    5633:  │                                                                          │  
    5634:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    5635:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    5636:  │   209 │   │   try:                                                       │  
    5637:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    5638:  │   211 │   │   except StopAsyncIteration:                                 │  
    5639:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    5665:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5666:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    5667:  │                                                                          │  
    5668:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    5669:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    5670:  │   209 │   │   try:                                                       │  
    5671:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    5672:  │   211 │   │   except StopAsyncIteration:                                 │  
    5673:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    5699:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5700:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    5701:  │                                                                          │  
    5702:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    5703:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    5704:  │   209 │   │   try:                                                       │  
    5705:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    5706:  │   211 │   │   except StopAsyncIteration:                                 │  
    5707:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    5733:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5734:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    5735:  │                                                                          │  
    5736:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    5737:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    5738:  │   209 │   │   try:                                                       │  
    5739:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    5740:  │   211 │   │   except StopAsyncIteration:                                 │  
    5741:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    5767:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5768:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    5769:  │                                                                          │  
    5770:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    5771:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    5772:  │   209 │   │   try:                                                       │  
    5773:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    5774:  │   211 │   │   except StopAsyncIteration:                                 │  
    5775:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    5801:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5802:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    5803:  │                                                                          │  
    5804:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    5805:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    5806:  │   209 │   │   try:                                                       │  
    5807:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    5808:  │   211 │   │   except StopAsyncIteration:                                 │  
    5809:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    5835:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5836:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    5837:  │                                                                          │  
    5838:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    5839:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    5840:  │   209 │   │   try:                                                       │  
    5841:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    5842:  │   211 │   │   except StopAsyncIteration:                                 │  
    5843:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    5869:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5870:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    5871:  │                                                                          │  
    5872:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    5873:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    5874:  │   209 │   │   try:                                                       │  
    5875:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    5876:  │   211 │   │   except StopAsyncIteration:                                 │  
    5877:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    5903:  │ /home/runner/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/ │  
    5904:  │ python3.12/contextlib.py:210 in __aenter__                               │  
    5905:  │                                                                          │  
    5906:  │   207 │   │   # they are only needed for recreation, which is not possib │  
    5907:  │   208 │   │   del self.args, self.kwds, self.func                        │  
    5908:  │   209 │   │   try:                                                       │  
    5909:  │ ❱ 210 │   │   │   return await anext(self.gen)                           │  
    5910:  │   211 │   │   except StopAsyncIteration:                                 │  
    5911:  │   212 │   │   │   raise RuntimeError("generator didn't yield") from None │  
    ...
    
    5974:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    5975:  │                                                                          │  
    5976:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
    5977:  │ ges/asyncpg/pool.py:361 in __init__                                      │  
    5978:  │                                                                          │  
    5979:  │    358 │   │   │   │   'min_size is expected to be greater or equal to z │  
    5980:  │    359 │   │                                                             │  
    5981:  │    360 │   │   if min_size > max_size:                                   │  
    5982:  │ ❱  361 │   │   │   raise ValueError('min_size is greater than max_size') │  
    5983:  │    362 │   │                                                             │  
    5984:  │    363 │   │   if max_queries <= 0:                                      │  
    5985:  │    364 │   │   │   raise ValueError('max_queries is expected to be great │  
    ...
    
    5999:  │ │                        max_size = 4                                  │ │  
    6000:  │ │                        min_size = 10                                 │ │  
    6001:  │ │                           reset = None                               │ │  
    6002:  │ │                            self = <asyncpg.pool.Pool object at       │ │  
    6003:  │ │                                   0x7f6768180100>                    │ │  
    6004:  │ │                           setup = None                               │ │  
    6005:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    6006:  ╰──────────────────────────────────────────────────────────────────────────╯  
    6007:  ValueError: min_size is greater than max_size                                 
    ...
    
    6387:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    6388:  │                                                                          │  
    6389:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
    6390:  │ ges/ward/testing.py:637 in _resolve_single_arg                           │  
    6391:  │                                                                          │  
    6392:  │   634 │   │   │   else:                                                  │  
    6393:  │   635 │   │   │   │   fixture.resolved_val = arg(**args_to_inject)       │  
    6394:  │   636 │   │   except (Exception, SystemExit) as e:                       │  
    6395:  │ ❱ 637 │   │   │   raise FixtureError(f"Unable to resolve fixture '{fixtu │  
    ...
    
    6535:  │ │                     │   │   timer=<ward._testing._Timer object at    │ │  
    6536:  │ │                     0x7f676939ddf0>,                                 │ │  
    6537:  │ │                     │   │   tags=[]                                  │ │  
    6538:  │ │                     │   ),                                           │ │  
    6539:  │ │                     │   iteration=0                                  │ │  
    6540:  │ │                     )                                                │ │  
    6541:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
    6542:  ╰──────────────────────────────────────────────────────────────────────────╯  
    6543:  FixtureError: Unable to resolve fixture 'client'                              
    6544:  ────────────────────────────────────────────────────────────────────────────────
    6545:  ╭──────────── Results ─────────────╮
    6546:  │  12  Tests Encountered           │
    6547:  │   9  Passes             (75.0%)  │
    6548:  │   3  Failures           (25.0%)  │
    6549:  ╰──────────────────────────────────╯
    6550:  ─────────────────────────── FAILED in 52.73 seconds ────────────────────────────
    6551:  ##[error]Process completed with exit code 1.
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically pro...

    Copy link
    Contributor

    @ellipsis-dev ellipsis-dev bot left a comment

    Choose a reason for hiding this comment

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

    👍 Looks good to me! Incremental review on 0aa9621 in 10 seconds

    More details
    • Looked at 13 lines of code in 1 files
    • Skipped 0 files when reviewing.
    • Skipped posting 1 drafted comments based on config settings.
    1. agents-api/agents_api/queries/agents/patch_agent.py:83
    • Draft comment:
      Ensure data.instructions is not None before converting it to a list. This prevents passing [None] when instructions is None.
    • Reason this comment was not posted:
      Comment did not seem useful.

    Workflow ID: wflow_I4T2znBq9s9SoO3l


    You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

    @whiterabbit1983 whiterabbit1983 merged commit cd1004c into dev Jan 14, 2025
    12 of 14 checks passed
    @whiterabbit1983 whiterabbit1983 deleted the x/patch-agent-query branch January 14, 2025 14:42
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant