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

chore(typespec): bump typespec + refactor system tools #1304

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

Ahmad-mtos
Copy link
Contributor

No description provided.

Copy link
Contributor

qodo-merge-pro-for-open-source bot commented Apr 2, 2025

CI Feedback 🧐

(Feedback updated until commit 27d1f00)

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: Test

Failed stage: [❌]

Failed test name: test_chat_routes:39 chat: check that non-recall gather_messages works

Failure summary:

The action failed because of validation errors in the Session model. Three tests in
test_chat_routes.py failed:

1. test_chat_routes:39 chat: check that non-recall gather_messages works
2. test_chat_routes:80
chat: check that gather_messages works
3. test_chat_routes:128 chat: check that chat route calls
both mocks

All failures show the same error pattern: a required field kind is missing in the Session model. The
validation error occurs when trying to create a Session object with only a developer_id field, but
the model requires a kind field as well.

Error message: Field required [type=missing, input_value={'developer_id': UUID('...')},
input_type=dict]

Relevant error logs:
1:  ##[group]Operating System
2:  Ubuntu
...

1452:  35/u enhanced_indices (120.549831ms)
1453:  PASS  test_agent_metadata_filtering:14 query: list_agents with metadata      3%
1454:  filtering                               
1455:  PASS  test_agent_metadata_filtering:67 query: list_agents with SQL           3%
1456:  injection attempt in metadata           
1457:  filter                                  
1458:  PASS  test_agent_queries:27 query: create agent sql                          4%
1459:  PASS  test_agent_queries:43 query: create or update agent sql                4%
1460:  PASS  test_agent_queries:62 query: update agent sql                          4%
1461:  PASS  test_agent_queries:89 query: get agent not exists sql                  5%
1462:  PASS  test_agent_queries:100 query: get agent exists sql                     5%
1463:  PASS  test_agent_queries:121 query: list agents sql                          5%
1464:  PASS  test_agent_queries:132 query: patch agent sql                          6%
1465:  PASS  test_agent_queries:156 query: delete agent sql                         6%
1466:  INFO:httpx:HTTP Request: POST http://testserver/agents "HTTP/1.1 403 Forbidden"
1467:  PASS  test_agent_routes:9 route: unauthorized should fail                    6%
1468:  INFO:httpx:HTTP Request: POST http://testserver/agents "HTTP/1.1 201 Created"
...

1499:  PASS  test_base_evaluate:187 utility: base_evaluate - backwards             12%
1500:  compatibility                                     
1501:  PASS  test_base_evaluate:222 utility: backwards_compatibility               12%
1502:  PASS  test_base_evaluate:280 validate_py_expression should return early     12%
1503:  for non-dollar expressions                        
1504:  PASS  test_base_evaluate:299 validate_py_expression should handle dollar    13%
1505:  sign variations                                   
1506:  PASS  test_base_evaluate:323 validate_py_expression should handle edge      13%
1507:  cases                                             
1508:  PASS  test_chat_routes:31 chat: check that patching libs works              13%
1509:  FAIL  test_chat_routes:39 chat: check that non-recall gather_messages       14%
1510:  works                                                
1511:  FAIL  test_chat_routes:80 chat: check that gather_messages works            14%
1512:  FAIL  test_chat_routes:128 chat: check that chat route calls both mocks     14%
1513:  ────────────── chat: check that non-recall gather_messages works ───────────────
1514:  Failed at tests/test_chat_routes.py                                           
1515:  ╭─────────────────── Traceback (most recent call last) ────────────────────╮  
1516:  │ /home/runner/work/julep/julep/agents-api/agents_api/queries/utils.py:279 │  
1517:  │ in async_wrapper                                                         │  
1518:  │                                                                          │  
1519:  │   276 │   │   @wraps(func)                                               │  
1520:  │   277 │   │   async def async_wrapper(*args: P.args, **kwargs: P.kwargs) │  
1521:  │   278 │   │   │   try:                                                   │  
1522:  │ ❱ 279 │   │   │   │   result: T = await func(*args, **kwargs)            │  
1523:  │   280 │   │   │   except BaseException as error:                         │  
1524:  │   281 │   │   │   │   _check_error(error)                                │  
1525:  │   282 │   │   │   │   raise error                                        │  
1526:  │                                                                          │  
...

1651:  │ │        │   'situation': None,                                        │ │  
1652:  │ │        │   'system_template': 'test system template',                │ │  
1653:  │ │        │   'created_at': datetime.datetime(2025, 4, 7, 16, 32, 41,   │ │  
1654:  │ │        810124, tzinfo=datetime.timezone.utc),                        │ │  
1655:  │ │        │   'updated_at': datetime.datetime(2025, 4, 7, 16, 32, 41,   │ │  
1656:  │ │        810124, tzinfo=datetime.timezone.utc),                        │ │  
1657:  │ │        │   'metadata': {'test': 'test'},                             │ │  
1658:  │ │        │   'render_templates': True,                                 │ │  
1659:  │ │        │   'token_budget': None,                                     │ │  
1660:  │ │        │   'context_overflow': None,                                 │ │  
1661:  │ │        │   ... +3                                                    │ │  
1662:  │ │        }                                                             │ │  
1663:  │ │ self = Session()                                                     │ │  
1664:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
1665:  ╰──────────────────────────────────────────────────────────────────────────╯  
1666:  ValidationError: 1 validation error for Session                               
1667:  kind                                                                          
1668:  Field required [type=missing, input_value={'developer_id':                  
1669:  UUID('00...938-8000-cc845a021b72')}, input_type=dict]                         
1670:  For further information visit https://errors.pydantic.dev/2.10/v/missing  
1671:  The above exception was the direct cause of the following exception:          
...

1981:  │                                                                          │  
1982:  │ ╭───────────────────────────── locals ─────────────────────────────╮     │  
1983:  │ │        debug = None                                              │     │  
1984:  │ │ loop_factory = None                                              │     │  
1985:  │ │         main = <coroutine object test_session at 0x7efff1b62790> │     │  
1986:  │ │       runner = <asyncio.runners.Runner object at 0x7efff878a330> │     │  
1987:  │ ╰──────────────────────────────────────────────────────────────────╯     │  
1988:  │                                                                          │  
1989:  │ /home/runner/.local/share/uv/python/cpython-3.12.9-linux-x86_64-gnu/lib/ │  
1990:  │ python3.12/asyncio/runners.py:118 in run                                 │  
1991:  │                                                                          │  
1992:  │   115 │   │                                                              │  
1993:  │   116 │   │   self._interrupt_count = 0                                  │  
1994:  │   117 │   │   try:                                                       │  
1995:  │ ❱ 118 │   │   │   return self._loop.run_until_complete(task)             │  
1996:  │   119 │   │   except exceptions.CancelledError:                          │  
1997:  │   120 │   │   │   if self._interrupt_count > 0:                          │  
...

2057:  │ │                │   metadata={},                                      │ │  
2058:  │ │                │   created_at=datetime.datetime(2025, 4, 7, 16, 32,  │ │  
2059:  │ │                41, 602780, tzinfo=datetime.timezone.utc),            │ │  
2060:  │ │                │   updated_at=datetime.datetime(2025, 4, 7, 16, 32,  │ │  
2061:  │ │                41, 602780, tzinfo=datetime.timezone.utc),            │ │  
2062:  │ │                │   name='test user',                                 │ │  
2063:  │ │                │   about='test user about'                           │ │  
2064:  │ │                )                                                     │ │  
2065:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
2066:  │                                                                          │  
2067:  │ /home/runner/work/julep/julep/agents-api/agents_api/queries/utils.py:281 │  
2068:  │ in async_wrapper                                                         │  
2069:  │                                                                          │  
2070:  │   278 │   │   │   try:                                                   │  
2071:  │   279 │   │   │   │   result: T = await func(*args, **kwargs)            │  
2072:  │   280 │   │   │   except BaseException as error:                         │  
2073:  │ ❱ 281 │   │   │   │   _check_error(error)                                │  
2074:  │   282 │   │   │   │   raise error                                        │  
2075:  │   283 │   │   │                                                          │  
...

2089:  │ │          │   │   system_template='test system template',             │ │  
2090:  │ │          │   │   render_templates=True,                              │ │  
2091:  │ │          │   │   token_budget=None,                                  │ │  
2092:  │ │          │   │   context_overflow=None,                              │ │  
2093:  │ │          │   │   auto_run_tools=False,                               │ │  
2094:  │ │          │   │   forward_tool_calls=False,                           │ │  
2095:  │ │          │   │   recall_options=None,                                │ │  
2096:  │ │          │   │   metadata={'test': 'test'}                           │ │  
2097:  │ │          │   ),                                                      │ │  
2098:  │ │          │   'connection_pool': <asyncpg.pool.Pool object at         │ │  
2099:  │ │          0x7efff93be140>                                             │ │  
2100:  │ │          }                                                           │ │  
2101:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
2102:  │                                                                          │  
2103:  │ /home/runner/work/julep/julep/agents-api/agents_api/queries/utils.py:271 │  
2104:  │ in _check_error                                                          │  
2105:  │                                                                          │  
2106:  │   268 │   │   │   │   setattr(new_error, "__cause__", error)             │  
2107:  │   269 │   │   │   │                                                      │  
2108:  │   270 │   │   │   │   print(error)                                       │  
2109:  │ ❱ 271 │   │   │   │   raise new_error from error                         │  
2110:  │   272 │                                                                  │  
2111:  │   273 │   def decorator(                                                 │  
2112:  │   274 │   │   func: Callable[P, T | Awaitable[T]],                       │  
2113:  │                                                                          │  
2114:  │ ╭─────────────────────────────── locals ───────────────────────────────╮ │  
2115:  │ │        error = 1 validation error for Session                        │ │  
2116:  │ │                kind                                                  │ │  
2117:  │ │                  Field required [type=missing,                       │ │  
2118:  │ │                input_value={'developer_id':                          │ │  
2119:  │ │                UUID('00...938-8000-cc845a021b72')}, input_type=dict] │ │  
2120:  │ │                │   For further information visit                     │ │  
2121:  │ │                https://errors.pydantic.dev/2.10/v/missing            │ │  
2122:  │ │      mapping = {                                                     │ │  
2123:  │ │                │   <function common_db_exceptions.<locals>.<lambda>  │ │  
2124:  │ │                at 0x7efffe35a160>: <class                            │ │  
2125:  │ │                'fastapi.exceptions.HTTPException'>,                  │ │  
2126:  │ │                │   <function common_db_exceptions.<locals>.<lambda>  │ │  
2127:  │ │                at 0x7efffe35a340>: <function                         │ │  
2128:  │ │                common_db_exceptions.<locals>._invalid_reference_err… │ │  
2129:  │ │                at 0x7efffe35a200>,                                   │ │  
2130:  │ │                │   <class                                            │ │  
2131:  │ │                'asyncpg.exceptions.ForeignKeyViolationError'>:       │ │  
2132:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
2133:  │ │                │   <class                                            │ │  
2134:  │ │                'asyncpg.exceptions.UniqueViolationError'>: <class    │ │  
2135:  │ │                'fastapi.exceptions.HTTPException'>,                  │ │  
2136:  │ │                │   <class 'asyncpg.exceptions.CheckViolationError'>: │ │  
2137:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
2138:  │ │                │   <class 'asyncpg.exceptions.DataError'>: <class    │ │  
2139:  │ │                'fastapi.exceptions.HTTPException'>,                  │ │  
2140:  │ │                │   <class 'asyncpg.exceptions.NoDataFoundError'>:    │ │  
2141:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
2142:  │ │                │   <class 'socket.gaierror'>: <class                 │ │  
2143:  │ │                'fastapi.exceptions.HTTPException'>,                  │ │  
2144:  │ │                │   <class                                            │ │  
2145:  │ │                'asyncpg.exceptions.InvalidTextRepresentationError'>: │ │  
2146:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
2147:  │ │                │   <class                                            │ │  
2148:  │ │                'asyncpg.exceptions.NumericValueOutOfRangeError'>:    │ │  
2149:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
2150:  │ │                │   ... +8                                            │ │  
2151:  │ │                }                                                     │ │  
2152:  │ │    new_error = HTTPException(status_code=400, detail='Invalid value  │ │  
2153:  │ │                provided for session during create')                  │ │  
...

2549:  │ │                      │   │   ),                                      │ │  
2550:  │ │                      │   │   timer=<ward._testing._Timer object at   │ │  
2551:  │ │                      0x7efff8782450>,                                │ │  
2552:  │ │                      │   │   tags=[]                                 │ │  
2553:  │ │                      │   ),                                          │ │  
2554:  │ │                      │   iteration=0                                 │ │  
2555:  │ │                      )                                               │ │  
2556:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
2557:  │                                                                          │  
2558:  │ /home/runner/work/julep/julep/agents-api/.venv/lib/python3.12/site-packa │  
2559:  │ ges/ward/testing.py:637 in _resolve_single_arg                           │  
2560:  │                                                                          │  
2561:  │   634 │   │   │   else:                                                  │  
2562:  │   635 │   │   │   │   fixture.resolved_val = arg(**args_to_inject)       │  
2563:  │   636 │   │   except (Exception, SystemExit) as e:                       │  
2564:  │ ❱ 637 │   │   │   raise FixtureError(f"Unable to resolve fixture '{fixtu │  
2565:  │   638 │   │   scope_key = self.test.scope_key_from(fixture.scope)        │  
...

2841:  │ │                     │   │   │   description=None,                    │ │  
2842:  │ │                     │   │   │   tags=None,                           │ │  
2843:  │ │                     │   │   │   is_fixture=False,                    │ │  
2844:  │ │                     │   │   │   scope=<Scope.Test: 'test'>,          │ │  
2845:  │ │                     │   │   │   bound_args=None,                     │ │  
2846:  │ │                     │   │   │   path=None                            │ │  
2847:  │ │                     │   │   ),                                       │ │  
2848:  │ │                     │   │   timer=<ward._testing._Timer object at    │ │  
2849:  │ │                     0x7efff8782450>,                                 │ │  
2850:  │ │                     │   │   tags=[]                                  │ │  
2851:  │ │                     │   ),                                           │ │  
2852:  │ │                     │   iteration=0                                  │ │  
2853:  │ │                     )                                                │ │  
2854:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
2855:  ╰──────────────────────────────────────────────────────────────────────────╯  
2856:  FixtureError: Unable to resolve fixture 'test_session'                        
2857:  Captured stdout                                                               
2858:  1 validation error for Session                                              
2859:  kind                                                                        
2860:  Field required                                                            
2861:  For further information visit https://errors.pydantic.dev/2.10/v/missing
2862:  ──────────────────── chat: check that gather_messages works ────────────────────
2863:  Failed at tests/test_chat_routes.py                                           
2864:  ╭─────────────────── Traceback (most recent call last) ────────────────────╮  
2865:  │ /home/runner/work/julep/julep/agents-api/agents_api/queries/utils.py:279 │  
2866:  │ in async_wrapper                                                         │  
2867:  │                                                                          │  
2868:  │   276 │   │   @wraps(func)                                               │  
2869:  │   277 │   │   async def async_wrapper(*args: P.args, **kwargs: P.kwargs) │  
2870:  │   278 │   │   │   try:                                                   │  
2871:  │ ❱ 279 │   │   │   │   result: T = await func(*args, **kwargs)            │  
2872:  │   280 │   │   │   except BaseException as error:                         │  
2873:  │   281 │   │   │   │   _check_error(error)                                │  
2874:  │   282 │   │   │   │   raise error                                        │  
2875:  │                                                                          │  
...

3000:  │ │        │   'situation': 'test session about',                        │ │  
3001:  │ │        │   'system_template': None,                                  │ │  
3002:  │ │        │   'created_at': datetime.datetime(2025, 4, 7, 16, 32, 42,   │ │  
3003:  │ │        653598, tzinfo=datetime.timezone.utc),                        │ │  
3004:  │ │        │   'updated_at': datetime.datetime(2025, 4, 7, 16, 32, 42,   │ │  
3005:  │ │        653598, tzinfo=datetime.timezone.utc),                        │ │  
3006:  │ │        │   'metadata': {},                                           │ │  
3007:  │ │        │   'render_templates': True,                                 │ │  
3008:  │ │        │   'token_budget': None,                                     │ │  
3009:  │ │        │   'context_overflow': None,                                 │ │  
3010:  │ │        │   ... +3                                                    │ │  
3011:  │ │        }                                                             │ │  
3012:  │ │ self = Session()                                                     │ │  
3013:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
3014:  ╰──────────────────────────────────────────────────────────────────────────╯  
3015:  ValidationError: 1 validation error for Session                               
3016:  kind                                                                          
3017:  Field required [type=missing, input_value={'developer_id':                  
3018:  UUID('00...784-8000-08616bc6dc1f')}, input_type=dict]                         
3019:  For further information visit https://errors.pydantic.dev/2.10/v/missing  
3020:  The above exception was the direct cause of the following exception:          
...

3032:  │                                                                          │  
3033:  │ ╭───────────────────────────── locals ─────────────────────────────╮     │  
3034:  │ │        debug = None                                              │     │  
3035:  │ │ loop_factory = None                                              │     │  
3036:  │ │         main = <coroutine object _ at 0x7efff1b9d8b0>            │     │  
3037:  │ │       runner = <asyncio.runners.Runner object at 0x7efff8789f10> │     │  
3038:  │ ╰──────────────────────────────────────────────────────────────────╯     │  
3039:  │                                                                          │  
3040:  │ /home/runner/.local/share/uv/python/cpython-3.12.9-linux-x86_64-gnu/lib/ │  
3041:  │ python3.12/asyncio/runners.py:118 in run                                 │  
3042:  │                                                                          │  
3043:  │   115 │   │                                                              │  
3044:  │   116 │   │   self._interrupt_count = 0                                  │  
3045:  │   117 │   │   try:                                                       │  
3046:  │ ❱ 118 │   │   │   return self._loop.run_until_complete(task)             │  
3047:  │   119 │   │   except exceptions.CancelledError:                          │  
3048:  │   120 │   │   │   if self._interrupt_count > 0:                          │  
...

3147:  │ │                │   metadata={},                                      │ │  
3148:  │ │                │   created_at=datetime.datetime(2025, 4, 7, 16, 32,  │ │  
3149:  │ │                42, 451608, tzinfo=datetime.timezone.utc),            │ │  
3150:  │ │                │   updated_at=datetime.datetime(2025, 4, 7, 16, 32,  │ │  
3151:  │ │                42, 451608, tzinfo=datetime.timezone.utc),            │ │  
3152:  │ │                │   name='test user',                                 │ │  
3153:  │ │                │   about='test user about'                           │ │  
3154:  │ │                )                                                     │ │  
3155:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
3156:  │                                                                          │  
3157:  │ /home/runner/work/julep/julep/agents-api/agents_api/queries/utils.py:281 │  
3158:  │ in async_wrapper                                                         │  
3159:  │                                                                          │  
3160:  │   278 │   │   │   try:                                                   │  
3161:  │   279 │   │   │   │   result: T = await func(*args, **kwargs)            │  
3162:  │   280 │   │   │   except BaseException as error:                         │  
3163:  │ ❱ 281 │   │   │   │   _check_error(error)                                │  
3164:  │   282 │   │   │   │   raise error                                        │  
3165:  │   283 │   │   │                                                          │  
...

3179:  │ │          │   │   system_template=None,                               │ │  
3180:  │ │          │   │   render_templates=True,                              │ │  
3181:  │ │          │   │   token_budget=None,                                  │ │  
3182:  │ │          │   │   context_overflow=None,                              │ │  
3183:  │ │          │   │   auto_run_tools=False,                               │ │  
3184:  │ │          │   │   forward_tool_calls=False,                           │ │  
3185:  │ │          │   │   recall_options=None,                                │ │  
3186:  │ │          │   │   metadata=None                                       │ │  
3187:  │ │          │   ),                                                      │ │  
3188:  │ │          │   'connection_pool': <asyncpg.pool.Pool object at         │ │  
3189:  │ │          0x7efff8f441c0>                                             │ │  
3190:  │ │          }                                                           │ │  
3191:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
3192:  │                                                                          │  
3193:  │ /home/runner/work/julep/julep/agents-api/agents_api/queries/utils.py:271 │  
3194:  │ in _check_error                                                          │  
3195:  │                                                                          │  
3196:  │   268 │   │   │   │   setattr(new_error, "__cause__", error)             │  
3197:  │   269 │   │   │   │                                                      │  
3198:  │   270 │   │   │   │   print(error)                                       │  
3199:  │ ❱ 271 │   │   │   │   raise new_error from error                         │  
3200:  │   272 │                                                                  │  
3201:  │   273 │   def decorator(                                                 │  
3202:  │   274 │   │   func: Callable[P, T | Awaitable[T]],                       │  
3203:  │                                                                          │  
3204:  │ ╭─────────────────────────────── locals ───────────────────────────────╮ │  
3205:  │ │        error = 1 validation error for Session                        │ │  
3206:  │ │                kind                                                  │ │  
3207:  │ │                  Field required [type=missing,                       │ │  
3208:  │ │                input_value={'developer_id':                          │ │  
3209:  │ │                UUID('00...784-8000-08616bc6dc1f')}, input_type=dict] │ │  
3210:  │ │                │   For further information visit                     │ │  
3211:  │ │                https://errors.pydantic.dev/2.10/v/missing            │ │  
3212:  │ │      mapping = {                                                     │ │  
3213:  │ │                │   <function common_db_exceptions.<locals>.<lambda>  │ │  
3214:  │ │                at 0x7efffe35a160>: <class                            │ │  
3215:  │ │                'fastapi.exceptions.HTTPException'>,                  │ │  
3216:  │ │                │   <function common_db_exceptions.<locals>.<lambda>  │ │  
3217:  │ │                at 0x7efffe35a340>: <function                         │ │  
3218:  │ │                common_db_exceptions.<locals>._invalid_reference_err… │ │  
3219:  │ │                at 0x7efffe35a200>,                                   │ │  
3220:  │ │                │   <class                                            │ │  
3221:  │ │                'asyncpg.exceptions.ForeignKeyViolationError'>:       │ │  
3222:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
3223:  │ │                │   <class                                            │ │  
3224:  │ │                'asyncpg.exceptions.UniqueViolationError'>: <class    │ │  
3225:  │ │                'fastapi.exceptions.HTTPException'>,                  │ │  
3226:  │ │                │   <class 'asyncpg.exceptions.CheckViolationError'>: │ │  
3227:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
3228:  │ │                │   <class 'asyncpg.exceptions.DataError'>: <class    │ │  
3229:  │ │                'fastapi.exceptions.HTTPException'>,                  │ │  
3230:  │ │                │   <class 'asyncpg.exceptions.NoDataFoundError'>:    │ │  
3231:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
3232:  │ │                │   <class 'socket.gaierror'>: <class                 │ │  
3233:  │ │                'fastapi.exceptions.HTTPException'>,                  │ │  
3234:  │ │                │   <class                                            │ │  
3235:  │ │                'asyncpg.exceptions.InvalidTextRepresentationError'>: │ │  
3236:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
3237:  │ │                │   <class                                            │ │  
3238:  │ │                'asyncpg.exceptions.NumericValueOutOfRangeError'>:    │ │  
3239:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
3240:  │ │                │   ... +8                                            │ │  
3241:  │ │                }                                                     │ │  
3242:  │ │    new_error = HTTPException(status_code=400, detail='Invalid value  │ │  
3243:  │ │                provided for session during create')                  │ │  
3244:  │ │ should_catch = True                                                  │ │  
3245:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
3246:  ╰──────────────────────────────────────────────────────────────────────────╯  
3247:  HTTPException: 400: Invalid value provided for session during create          
3248:  Captured stdout                                                               
3249:  1 validation error for Session                                              
3250:  kind                                                                        
3251:  Field required                                                            
3252:  For further information visit https://errors.pydantic.dev/2.10/v/missing
3253:  ───────────────── chat: check that chat route calls both mocks ─────────────────
3254:  Failed at tests/test_chat_routes.py                                           
3255:  ╭─────────────────── Traceback (most recent call last) ────────────────────╮  
3256:  │ /home/runner/work/julep/julep/agents-api/agents_api/queries/utils.py:279 │  
3257:  │ in async_wrapper                                                         │  
3258:  │                                                                          │  
3259:  │   276 │   │   @wraps(func)                                               │  
3260:  │   277 │   │   async def async_wrapper(*args: P.args, **kwargs: P.kwargs) │  
3261:  │   278 │   │   │   try:                                                   │  
3262:  │ ❱ 279 │   │   │   │   result: T = await func(*args, **kwargs)            │  
3263:  │   280 │   │   │   except BaseException as error:                         │  
3264:  │   281 │   │   │   │   _check_error(error)                                │  
3265:  │   282 │   │   │   │   raise error                                        │  
3266:  │                                                                          │  
...

3420:  │ │        │   'situation': 'test session about',                        │ │  
3421:  │ │        │   'system_template': None,                                  │ │  
3422:  │ │        │   'created_at': datetime.datetime(2025, 4, 7, 16, 32, 43,   │ │  
3423:  │ │        87653, tzinfo=datetime.timezone.utc),                         │ │  
3424:  │ │        │   'updated_at': datetime.datetime(2025, 4, 7, 16, 32, 43,   │ │  
3425:  │ │        87653, tzinfo=datetime.timezone.utc),                         │ │  
3426:  │ │        │   'metadata': {},                                           │ │  
3427:  │ │        │   'render_templates': True,                                 │ │  
3428:  │ │        │   'token_budget': None,                                     │ │  
3429:  │ │        │   'context_overflow': None,                                 │ │  
3430:  │ │        │   ... +3                                                    │ │  
3431:  │ │        }                                                             │ │  
3432:  │ │ self = Session()                                                     │ │  
3433:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
3434:  ╰──────────────────────────────────────────────────────────────────────────╯  
3435:  ValidationError: 1 validation error for Session                               
3436:  kind                                                                          
3437:  Field required [type=missing, input_value={'developer_id':                  
3438:  UUID('00...5af-8000-0f823dfbbf53')}, input_type=dict]                         
3439:  For further information visit https://errors.pydantic.dev/2.10/v/missing  
3440:  The above exception was the direct cause of the following exception:          
...

3452:  │                                                                          │  
3453:  │ ╭───────────────────────────── locals ─────────────────────────────╮     │  
3454:  │ │        debug = None                                              │     │  
3455:  │ │ loop_factory = None                                              │     │  
3456:  │ │         main = <coroutine object _ at 0x7efff1b9da20>            │     │  
3457:  │ │       runner = <asyncio.runners.Runner object at 0x7efff87a5010> │     │  
3458:  │ ╰──────────────────────────────────────────────────────────────────╯     │  
3459:  │                                                                          │  
3460:  │ /home/runner/.local/share/uv/python/cpython-3.12.9-linux-x86_64-gnu/lib/ │  
3461:  │ python3.12/asyncio/runners.py:118 in run                                 │  
3462:  │                                                                          │  
3463:  │   115 │   │                                                              │  
3464:  │   116 │   │   self._interrupt_count = 0                                  │  
3465:  │   117 │   │   try:                                                       │  
3466:  │ ❱ 118 │   │   │   return self._loop.run_until_complete(task)             │  
3467:  │   119 │   │   except exceptions.CancelledError:                          │  
3468:  │   120 │   │   │   if self._interrupt_count > 0:                          │  
...

3523:  │ │          dsn = '***localhost:32769/test?sslmode=d… │ │  
3524:  │ │        mocks = (                                                     │ │  
3525:  │ │                │   <AsyncMock name='aembedding'                      │ │  
3526:  │ │                id='139637850655392'>,                                │ │  
3527:  │ │                │   <AsyncMock name='acompletion'                     │ │  
3528:  │ │                id='139637850678976'>                                 │ │  
3529:  │ │                )                                                     │ │  
3530:  │ │         pool = <asyncpg.pool.Pool object at 0x7efff8f44f40>          │ │  
3531:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
3532:  │                                                                          │  
3533:  │ /home/runner/work/julep/julep/agents-api/agents_api/queries/utils.py:281 │  
3534:  │ in async_wrapper                                                         │  
3535:  │                                                                          │  
3536:  │   278 │   │   │   try:                                                   │  
3537:  │   279 │   │   │   │   result: T = await func(*args, **kwargs)            │  
3538:  │   280 │   │   │   except BaseException as error:                         │  
3539:  │ ❱ 281 │   │   │   │   _check_error(error)                                │  
3540:  │   282 │   │   │   │   raise error                                        │  
3541:  │   283 │   │   │                                                          │  
...

3567:  │ │          │   │   │   mode='hybrid',                                  │ │  
3568:  │ │          │   │   │   confidence=0.6,                                 │ │  
3569:  │ │          │   │   │   alpha=0.5,                                      │ │  
3570:  │ │          │   │   │   mmr_strength=0.5,                               │ │  
3571:  │ │          │   │   │   trigram_similarity_threshold=0.4,               │ │  
3572:  │ │          │   │   │   k_multiplier=7                                  │ │  
3573:  │ │          │   │   ),                                                  │ │  
3574:  │ │          │   │   metadata=None                                       │ │  
3575:  │ │          │   ),                                                      │ │  
3576:  │ │          │   'connection_pool': <asyncpg.pool.Pool object at         │ │  
3577:  │ │          0x7efff8f44f40>                                             │ │  
3578:  │ │          }                                                           │ │  
3579:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
3580:  │                                                                          │  
3581:  │ /home/runner/work/julep/julep/agents-api/agents_api/queries/utils.py:271 │  
3582:  │ in _check_error                                                          │  
3583:  │                                                                          │  
3584:  │   268 │   │   │   │   setattr(new_error, "__cause__", error)             │  
3585:  │   269 │   │   │   │                                                      │  
3586:  │   270 │   │   │   │   print(error)                                       │  
3587:  │ ❱ 271 │   │   │   │   raise new_error from error                         │  
3588:  │   272 │                                                                  │  
3589:  │   273 │   def decorator(                                                 │  
3590:  │   274 │   │   func: Callable[P, T | Awaitable[T]],                       │  
3591:  │                                                                          │  
3592:  │ ╭─────────────────────────────── locals ───────────────────────────────╮ │  
3593:  │ │        error = 1 validation error for Session                        │ │  
3594:  │ │                kind                                                  │ │  
3595:  │ │                  Field required [type=missing,                       │ │  
3596:  │ │                input_value={'developer_id':                          │ │  
3597:  │ │                UUID('00...5af-8000-0f823dfbbf53')}, input_type=dict] │ │  
3598:  │ │                │   For further information visit                     │ │  
3599:  │ │                https://errors.pydantic.dev/2.10/v/missing            │ │  
3600:  │ │      mapping = {                                                     │ │  
3601:  │ │                │   <function common_db_exceptions.<locals>.<lambda>  │ │  
3602:  │ │                at 0x7efffe35a160>: <class                            │ │  
3603:  │ │                'fastapi.exceptions.HTTPException'>,                  │ │  
3604:  │ │                │   <function common_db_exceptions.<locals>.<lambda>  │ │  
3605:  │ │                at 0x7efffe35a340>: <function                         │ │  
3606:  │ │                common_db_exceptions.<locals>._invalid_reference_err… │ │  
3607:  │ │                at 0x7efffe35a200>,                                   │ │  
3608:  │ │                │   <class                                            │ │  
3609:  │ │                'asyncpg.exceptions.ForeignKeyViolationError'>:       │ │  
3610:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
3611:  │ │                │   <class                                            │ │  
3612:  │ │                'asyncpg.exceptions.UniqueViolationError'>: <class    │ │  
3613:  │ │                'fastapi.exceptions.HTTPException'>,                  │ │  
3614:  │ │                │   <class 'asyncpg.exceptions.CheckViolationError'>: │ │  
3615:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
3616:  │ │                │   <class 'asyncpg.exceptions.DataError'>: <class    │ │  
3617:  │ │                'fastapi.exceptions.HTTPException'>,                  │ │  
3618:  │ │                │   <class 'asyncpg.exceptions.NoDataFoundError'>:    │ │  
3619:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
3620:  │ │                │   <class 'socket.gaierror'>: <class                 │ │  
3621:  │ │                'fastapi.exceptions.HTTPException'>,                  │ │  
3622:  │ │                │   <class                                            │ │  
3623:  │ │                'asyncpg.exceptions.InvalidTextRepresentationError'>: │ │  
3624:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
3625:  │ │                │   <class                                            │ │  
3626:  │ │                'asyncpg.exceptions.NumericValueOutOfRangeError'>:    │ │  
3627:  │ │                <class 'fastapi.exceptions.HTTPException'>,           │ │  
3628:  │ │                │   ... +8                                            │ │  
3629:  │ │                }                                                     │ │  
3630:  │ │    new_error = HTTPException(status_code=400, detail='Invalid value  │ │  
3631:  │ │                provided for session during create')                  │ │  
3632:  │ │ should_catch = True                                                  │ │  
3633:  │ ╰──────────────────────────────────────────────────────────────────────╯ │  
3634:  ╰──────────────────────────────────────────────────────────────────────────╯  
3635:  HTTPException: 400: Invalid value provided for session during create          
3636:  Captured stdout                                                               
3637:  1 validation error for Session                                              
3638:  kind                                                                        
3639:  Field required                                                            
3640:  For further information visit https://errors.pydantic.dev/2.10/v/missing
3641:  ────────────────────────────────────────────────────────────────────────────────
3642:  ╭──────────── Results ─────────────╮
3643:  │  46  Tests Encountered           │
3644:  │  43  Passes             (93.5%)  │
3645:  │   3  Failures           (6.5%)   │
3646:  ╰──────────────────────────────────╯
3647:  ─────────────────────────── FAILED in 107.42 seconds ───────────────────────────
3648:  ##[error]The operation was canceled.
3649:  Post job cleanup.

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.

2 participants