Skip to content

Consolidated invalid-action suggestions render as undefined #69

@Mnehmos

Description

@Mnehmos

Summary

Many consolidated tools render invalid-action suggestions as undefined in the human-readable output, even though the embedded JSON contains the correct suggested action names.

References

  • src/utils/fuzzy-enum.ts:29
  • src/utils/fuzzy-enum.ts:184-194
  • Representative formatters:
    • src/server/consolidated/improvisation-manage.ts:769-770
    • src/server/consolidated/world-map.ts:269-270
    • src/server/consolidated/world-manage.ts:376-377
    • src/server/consolidated/turn-manage.ts:495-496

Direct Reproduction

Call improvisation_manage with an invalid action from the docs, for example:

{action:attempt_synthesis}

Observed text output:

Did you mean:
  - undefined (41% match)
  - undefined (29% match)
  - undefined (24% match)

Embedded JSON in the same response is correct:

suggestions:[
  {value:synthesize,similarity:41},
  {value:get_effects,similarity:29},
  {value:get_spellbook,similarity:24}
]

Cause

fuzzy-enum returns suggestions as { value, similarity }, but many consolidated tool formatters read them as { action, similarity }.

Impact

  • users lose the main benefit of guiding errors
  • natural-language output looks broken even when the machine-readable payload is correct
  • this affects multiple consolidated tools, not just one surface

Expected

Human-readable suggestion lists should show the suggested action names.

Actual

Many tools print undefined instead.

Suggested Direction

  • standardize suggestion objects on one shape across all formatters
  • update consolidated handlers to read value
  • add a shared regression test that exercises an invalid action across the consolidated tool layer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions