A third-party client can now say who it is: session.create takes an optional
client {name, version?}. It is attribution only. source still picks the
policy, and no toolset, approval, permission, prompt text or telemetry reads
the label.
- Validated beside the editor check (bounded, safe charset); a malformed value
is invalid_params on field client.
- Kept inside the frozen creation request, so there is no new column, receipt
key or policy field: an older owner restores the session, and the label is
part of the exact-retry identity.
- session.info.client echoes it (absent when none was sent); runtime.describe
lists client in session_create.parameters and capability session-client-v1.
- Plugins read it with hermes_cli.plugin_session.session_client() (published
in plugin_api.json) and the client / client_version keys of prompt-section
session info ("" when none). No PluginContext method, no hook kwarg.
- The classic CLI's /new copies the frozen launch request but never the
creating client's label: the new session belongs to the terminal.
- Contracts regenerated; docs say the label is self-declared and must never
grant anything.
The session_cwd() docstring did not say that in ingress hooks such as
pre_gateway_dispatch, which run before the message reaches any session,
it returns the profile's terminal cwd rather than the workspace of the
session the message will reach. The user docs already say so; the
docstring now does too.
Refs #134889 (LC-5)
Refs #139523
Since the one-gateway runtime, plugin hooks and tools of classic CLI,
TUI and Desktop sessions run in the gateway process. Plugins written for
the CLI broke there:
- inject_message() with neither session_key nor origin was refused. A
hook or tool running for a classic CLI session now resolves that
session's key from the turn context, and the text is committed to its
FIFO through the local session's own source and adapter (local
sessions have no messaging allowlist). allow_gateway_injection is
still required. Keyed injection into a local session is refused unless
the session authority registered for the calling plugin's own profile
holds that live session; ownership is never resolved through the
ambient profile scope.
- Approval hooks and transports saw surface='gateway' for CLI sessions.
They now report 'cli' again for a classic CLI session's turn. TUI,
Desktop and messaging keep 'gateway', as documented.
- os.getcwd() is the gateway's install root. ctx.session_cwd() and
ctx.session_surface() read the calling session's recorded workspace
and client from the turn's task-local policy. The gateway process is
never chdir-ed.
print() going to gateway-stdio.log and input() getting EOF are intended
differences, now documented in the plugin guide.
Refs #134889 (LC-5)
Refs #139523