A browser behind a same-machine dev proxy (e.g. Vite on localhost:5175)
sends Origin localhost while the upstream server is bound to 127.0.0.1;
the two are not string-equal so the WS upgrade was rejected with 403.
Treat loopback<->loopback (localhost / 127.0.0.1 / [::1] / *.localhost)
as same-origin. Public cross-origin is unchanged, auth (401) is unchanged.
Apply before_id/after_id id-cursors and page_size in the route handler
(FileSessionIndex does not implement a cursor, so page over its
recency-sorted result). Unknown cursor resolves to an empty terminal
page so clients cannot spin on a cursor the server cannot advance,
which caused the boot-time request storm on GET /api/v1/sessions.
SessionTodoService (Session scope, eager) created TodoListTool with
createInstance inside bindAgent, which also ran from the constructor
catch-up loop. TodoListTool injects ISessionTodoService, so when an agent
already existed this re-entered the in-progress SessionTodoService and
threw a sessionTodoService -> sessionTodoService CyclicDependencyError.
Contribute TodoListTool through the module-level registerTool used by every
other builtin; AgentBuiltinToolsRegistrar instantiates it per agent on the
Agent scope, where the parent ISessionTodoService is already constructed.
SessionTodoService now only binds the stale-todo reminder and the main
agent todo.set resumer.
- move the session's seeded cwd onto ISessionContext (set in sessionLifecycle)
and delete the IExecContext value plus the session/execContext domain
- remove the dead envLayers/withEnv/withCwd surface; the process runner keeps
only per-call options.env, matching v1 Kaos behaviour (no producer ever
populated layers)
- drop the unused IExecContext injection from rpcService
- remove the public execContext re-export (no in-repo consumers) and update the
layer map, the DI x Scope diagram source, and tests/harness (cwd now via
TestAgentOptions.cwd)
- remove ISessionWarningService/SessionWarningService skeleton, its barrel and test; the server-v2 warnings route already returns [] and nothing in v2 wired the service
- relocate SessionErrors codes to src/session/errors.ts so the redundant session/session/ directory is gone, and update the errors facade and package index exports
- add App-scope IFileEditService (textModel/editService/fileEdit) over IHostFileSystem, returning a domain-neutral FileEditResult
- turn EditTool into an Agent-scope adapter registered under app/edit/tools, injecting IFileEditService and mapping FileEditResult to ExecutableToolResult
- migrate edit tests to build EditTool through the container
The Session-scoped fs facade backs the Web UI edge surface
(/api/v1 fs routes and /api/v2 fs:* actions), not the Agent -- the
Agent uses the os file tools instead. The `agentFs` name was a
leftover from when the interface was IAgentFileSystem.
- rename src/session/agentFs -> src/session/sessionFs (and tests)
- update #/session/agentFs imports and the 'agentFs' domain string
- update check-domain-layers entries, header/cross-ref comments, docs
- rename the misleading planService `agentFs` field to `hostFs`
(it is an IHostFileSystem)
- move logging to _base/log (contract, plain sinks, BoundLogger, AppLogService);
drop Service suffix from new-able classes (RotatingFileWriter/FileLogWriter)
- single ILogService token: App and Session each bind an implementation, so
consumers inject @ILogService and the scope picks the sink; remove
ILogWriterService and ISessionLogService
- App log defaults to the global rotating file (fixes TUI console pollution and
the ignored KIMI_LOG_LEVEL), with every sink routed through the redacting formatter
- Agent scope falls back to the Session logger (multiple agents share one session
log file, so a single sink avoids rotate races)
- merge ISkillDiscovery into a single discover(roots); Global and Project
differ only by which roots are passed (root resolution moved to
userRoots/projectRoots, reusable without a Session)
- replace IGlobalSkillCatalog with pluggable ISkillSource producers
(builtin/user at App, workspace/plugin at Session) that push into the
Session skill sink
- SessionSkillCatalogService is now a priority-ordered merge sink
(plugin > workspace > user > builtin) with ready/onDidChange, plus
set/remove for future ad-hoc sources; fixes builtin wrongly winning
name collisions over user
- renderSkillPrompt takes sessionId as an argument instead of baking it
into the merged catalog value
- rename globalSkillCatalog -> skillCatalog; update the DI x Scope puml
and the domain-layer map
- collapse Storage role tokens (IStorageService/IAtomicDocumentStorage/
IAppendLogStorage/IBlobStorage) onto the single IFileSystemStorageService
byte layer, with Store facades (append-log, atomic document, blob) above it
- rename AtomicDocumentStore to JsonAtomicDocumentStore and update IBlobStore
references in server-v2
- add gen:contract-types script and tsconfig.contract.json for generating
contract types, and ignore the .contract-types-tmp build dir
- document the storage read/write model in docs/rw-model-design.md and refresh
the dep-graph analyzer and agent-core-dev skill docs
- update test stubs and server-v2 start/files to match
Align all DI service contracts on _serviceBrand first, a blank line, methods and properties, then hooks last when present.
Co-authored-by: Cursor <cursoragent@cursor.com>
Turn no longer carries or emits the triggering message id; prompt and goal
callers keep message identity in context memory instead.
Co-authored-by: Cursor <cursoragent@cursor.com>
- move todo from agent scope (`IAgentTodoListService`) to session scope
(`ISessionTodoService`); the list is now shared across every agent in a
session instead of per-agent.
- persist every change as a `todo.set` record on the main agent's wire, which
is the single source of truth and a replayable timeline; drop the agent
tool-store `'todo'` key and the atomic-doc persistence store.
- bind `TodoListTool` and the stale reminder into every agent via
`IAgentLifecycleService`, and register the `todo.set` resume resumer on the
main agent.
- migrate `fullCompaction` to read `ISessionTodoService`; register the `todo`
domain at L4 with a `todo>agentLifecycle` layer exception; refresh the DI
scope/domain diagram.
- remove the ISessionAgentFileSystem service and its node implementation
- extend IHostFileSystem with readText decode options and stat mtimeMs/ino
- route SessionFsService, profile context, media, and plan through IHostFileSystem
- drop the unused agentFs:* session REST endpoints from server-v2/server-e2e
- route read/write/grep/glob through host fs and process services
- add TextModel/EditService with an os-backed FileEditService
- update file tool tests, exports, layer rules, and DI docs
- add app/cron barrel re-exporting the cron task record, persistence contract/service, and dependency-free algorithm lib (cron-expr, jitter, clock, format)
- move cronTask persistence files from app/cronPersistence into app/cron and drop the old cronPersistence barrel
- register the cron config section (KIMI_CRON_* env bindings) via configSection
- repoint cron tests from #/agent/cron and #/app/cronPersistence to #/app/cron