Skip to content

gateway: design legacy main-alias remap boundary (agent:main:main → default agent) — un-skip sessions-resolve-store test #2733

Description

@alexey-pelykh

Problem

src/gateway/sessions-resolve.ts currently rejects the legacy session alias agent:main:main. There is a deferred design question: should it remap agent:main:main onto the live default agent instead of rejecting it? This needs a reviewed boundary (when/whether the remap applies) before implementing — an unconsidered remap risks unintended cross-agent resolution.

Current state

  • agent:main:main (legacy alias form) is rejected by sessions-resolve.ts.
  • src/gateway/sessions-resolve-store.test.ts (~line 17) has a test.skip pending this remap-boundary design.
  • The skip site carries an in-code TODO with the un-skip condition.

What to do

  1. Design the remap boundary — define precisely under what conditions agent:main:main should resolve to the live default agent vs. stay rejected. Consider:
    • Backward-compatibility with legacy clients emitting agent:main:main.
    • Ambiguity / collision risk (must not let the alias resolve to an unintended agent).
    • Security: no cross-agent resolution or privilege leakage via the alias.
  2. Implement the reviewed boundary in sessions-resolve.ts.
  3. Un-skip src/gateway/sessions-resolve-store.test.ts (~line 17) and make it pass.

Acceptance criteria

  • The remap-boundary decision is documented (in-code rationale and/or an ADR-style note).
  • sessions-resolve.ts implements the reviewed boundary.
  • The test.skip at sessions-resolve-store.test.ts (~line 17) is un-skipped and passes.
  • No regression to existing session-resolution behavior for non-legacy aliases.

Context

Split out from the gateway-suite remediation tracker #2724 (itself from #2720, "enable the gateway behavioral test suite in CI") as focused design+implementation work. This issue is self-contained; no external context is required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions