mycode-cli 0.8.0__py3-none-any.whl → 0.8.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -76,6 +76,8 @@ async def _stream_run(req: Request, state: RunState, after: int) -> AsyncIterato
76
76
  @router.post("/chat")
77
77
  async def chat(chat: ChatRequest, store: StoreDep, runs: RunManagerDep):
78
78
  cwd = os.path.abspath(chat.cwd or os.getcwd())
79
+ if not os.path.isdir(cwd):
80
+ raise HTTPException(status_code=400, detail=f"Working directory does not exist: {cwd}")
79
81
  settings = get_settings(cwd)
80
82
  resolved = resolve_provider(
81
83
  settings,
@@ -367,6 +369,7 @@ async def get_config(cwd: str | None = None):
367
369
  "default_reasoning_effort": settings.default_reasoning_effort,
368
370
  "reasoning_effort_options": REASONING_EFFORT_OPTIONS,
369
371
  "cwd": resolved_cwd,
372
+ "cwd_exists": os.path.isdir(resolved_cwd),
370
373
  "project": settings.project,
371
374
  "config_paths": settings.config_paths,
372
375
  }
@@ -31,6 +31,8 @@ def _redact_document_data(messages: list[ConversationMessage]) -> list[Conversat
31
31
  @router.post("")
32
32
  async def create_session(req: SessionCreateRequest, store: StoreDep):
33
33
  cwd = os.path.abspath(req.cwd or os.getcwd())
34
+ if not os.path.isdir(cwd):
35
+ raise HTTPException(status_code=400, detail=f"Working directory does not exist: {cwd}")
34
36
  session_id = uuid4().hex
35
37
  return await store.create_session(session_id, cwd=cwd)
36
38