Skip to content

create-alias & stage-scoped ops use frozen COREZOID_STAGE_ID -> cryptic "Object is not in stage" #26

Description

@vladyslavsamokysh-beep

Context

create-alias (and listAliasesByStage / env-var ops) resolve the stage from COREZOID_STAGE_ID, read once at MCP spawn (main.go). When that value isn't the stage where the target process lives, create-alias fails with Object is not in stage, which doesn't hint at the stage mismatch.

Example: a process living in project stage 10605 while the env had COREZOID_STAGE_ID=9026 (another project's stage) -> create-alias failed; push-process still worked (it targets by obj_id from the file).

Suggestions (any one would help)

  1. Derive the stage from the target process's actual location instead of the env stage.
  2. Accept an optional stage_id override param on stage-scoped tools.
  3. Improve the error: include expected vs configured stage_id.

Note on the alias-create contract

Creating an alias via the raw API needs obj_to_id + obj_to_type: "conv" (plus project_id), not obj_id/obj_type. Using obj_id creates an alias with obj_to_id: null, which then resolves at runtime as not_found_conv_by_alias. Worth guarding in create-alias.

🤖 Generated with Claude Code

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