Troubleshooting¶
This page covers common local setup and runtime issues.
agentengine Command Not Found¶
Confirm the virtual environment is active and the package is installed:
On Windows, reopen the shell after installation if the scripts directory was
added to PATH.
Project Not Detected¶
Run from the project root and check for an entry file:
The project should expose an agent variable, usually root_agent, from
agent.py, main.py, app.py, or a package module.
Recommended explicit config:
If detection still fails, create a minimal agent.py that exports the configured
variable and add imports back gradually.
Useful checks:
python - <<'PY'
from pathlib import Path
print(Path("agentengine.yaml").exists())
print(Path("agent.py").exists())
PY
If a project uses a src/ layout, make sure entry_point is relative to the
project root and that the configured object is imported or defined in that file.
Detection is static; it will not run setup code that dynamically creates the
agent variable.
Model Calls Fail¶
Check .env:
Confirm:
OPENAI_API_KEYis present.OPENAI_BASE_URLpoints to an OpenAI-compatible endpoint.OPENAI_MODEL_NAMEis accepted by the provider.- the provider supports streaming if you are using streaming mode.
Try a non-streaming run:
Try a one-run model override:
If the provider rejects the request, reproduce with a direct provider curl outside KsADK before debugging the framework adapter.
Web UI Does Not Open¶
Start without opening the browser automatically:
Open the printed local URL manually. If the port is busy:
If old conversations appear, remove local UI state:
API Server Port Is Busy¶
Choose another port:
Build Or Deploy Requires Cloud Credentials¶
Local development does not require cloud credentials. Commands such as
build, deploy, and launch can require Kingsoft Cloud credentials depending
on target and mode.
For review or documentation, use dry-run behavior where supported:
Do not place real credentials, private registry names, internal kubeconfig paths, or customer data in public issues, docs, tests, or examples.
Importing An Existing Agent Fails¶
Check the generated config:
Common fixes:
- set
frameworkexplicitly. - set
entry_pointto an existing Python file. - set
agent_variableto the exported object. - install missing framework dependencies.
- move side-effectful startup code behind
if __name__ == "__main__".
Responses API Session Error¶
If you see a conflict between conversation and session_id, use only one
session field:
Do not send a different session_id in the same request.
Streaming Client Hangs¶
When using stream: true, confirm your client consumes server-sent events.
For debugging, switch to non-streaming:
If non-streaming works, the issue is in the client event loop, proxy buffering, or SSE parser.
For the local Web UI, a browser refresh can disconnect the original stream while the run continues on the server. Reconnect-capable clients should use the known session id, invocation id, and last consumed event sequence id to read later run events. Do not assume reconnecting recreates the same TCP stream.
Uploaded File Is Ignored¶
Check whether the request uses a supported file shape:
For Web UI uploads, check that the later run request references the returned
ksadk-upload://... URI. That URI is local to the running server; it will not
work after deleting .agentengine/ui, moving the project, or sending the
request to another runtime.
If the file appears but the answer misses its content:
- confirm the file type is supported.
- check extraction warnings in the runner payload or logs.
- try a smaller text-only file to separate extraction issues from model issues.
- use
current_attachment_resultsin custom hooks when the current turn must process only newly uploaded files.
Follow-Up Question Loses File Context¶
The runtime can carry the most recent attachment context in the same session. If a follow-up question behaves like no file was provided, verify:
- the second request uses the same
conversation.idorsession_id. - the first request completed successfully.
- the client did not create a new local session after a page refresh.
- custom hooks read
attachment_resultswhen follow-up context is desired.
Use current_attachment_results only for current-turn files. It is expected to
be empty on a text-only follow-up.
Session History Looks Wrong¶
The runtime stores an append-only event log and projects model history from that
log. run_status and reasoning events are lifecycle or diagnostic events;
they are not normal model messages. If model history is unexpectedly long or
short:
- check whether context compaction created a checkpoint.
- verify the session id is stable across requests.
- inspect whether tool or approval events are being projected as text summaries.
- reset local development state with
rm -rf .agentengine/uiwhen you want a clean local Web UI session.
Public Docs Build Fails¶
Run:
Common causes:
- broken relative links.
- page added to
navbut not created. - duplicate Markdown extension entries.
- generated files under
site/accidentally committed. - docs referencing private files excluded from the public repository.
Need More Detail¶
Run command-specific help: