Skip to content

Text given for a key to ll or llcompat is passed as LSL passed it, not through uuid() - #437

Merged
RyeMutt merged 1 commit into
developfrom
rye/script-key-text
Oct 11, 2026
Merged

RyeMutt merged 1 commit into
developfrom
rye/script-key-text

Conversation

@RyeMutt

@RyeMutt RyeMutt commented Oct 10, 2026

Copy link
Copy Markdown
Member

A follow-up to #434 from Tapple's QA. Where an ll or llcompat function takes a key, the converter now passes LSL text as it is, as LSL's function took it. It no longer wraps the text in uuid(), which stops the script on text that isn't a UUID.

The problem

  • SLua's VM takes a key argument as a uuid or as any string (llsl.cpp, slua 0.732.16). The function then decides whether the text is a key, as LSL's did.
  • The definitions type these parameters uuid, so the converter wrapped text in uuid(). But uuid() raises "Unable to convert to UUID" on text that isn't a UUID.
  • Tapple's line was llKey2Name(llJsonGetValue(msg, ["selected"])). When the JSON has no "selected", llJsonGetValue returns JSON_INVALID. LSL's llKey2Name answered "" for that; the converted line stopped the script.

The change

  • Text going into an ll or llcompat key parameter is written as it is, with :: any so the type checker accepts it: ll.Key2Name(ll.JsonGetValue(msg, {"selected"}) :: any). Anything other than a single term is bracketed first.
  • A note, once per script, says why the cast is there.
  • A UUID written out in the LSL is still uuid("…").
  • A key parameter of the script's own function still takes uuid(), since its body may compare it with a uuid.
  • The definitions are unchanged. Typing key parameters uuid only is still the right nudge for code written in SLua.

Testing

  • allsltoslua 77/77 under both Luau solvers.
    • 84 is new, and also checks the output in strict mode and in close-to-LSL mode.
    • 23 is updated: llGetOwnerKey("abc") is no longer uuid("abc").
  • alscript ctest passes, apart from alluaufragment. It fails intermittently, and fails 3 runs in 6 without this change as well. That is the fragment answer at scope3.lsl 29:1.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 35c2d819-836e-47ed-8f0a-50a5891ec77d

📥 Commits

Reviewing files that changed from the base of the PR and between 3885a7b and 7e9a2da.


You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 283569d3-4fb7-4867-b76e-a4ae4af27b90


📥 Commits

Reviewing files that changed from the base of the PR and between 193bf34 and 3885a7b.



📒 Files selected for processing (3)
  • indra/alscript/lsl/allsltoslua.cpp
  • indra/alscript/tests/allsltoslua_test.cpp
  • indra/newview/skins/default/xui/en/strings.xml


Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.




📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • SLua now preserves text passed as key arguments to built-in ll and llcompat calls, rather than converting it to a UUID. UUID constants and key arguments to script-defined functions retain their existing behavior.
📝 Summary

Walkthrough

SLua conversion now preserves non-UUID text passed to built-in key parameters by emitting it with :: any. UUID constants and other values retain existing key coercion. Rule-table, ll, and llcompat call paths enable this handling, and tests cover the conversion.

Changes

Built-in key argument handling

Layer / File(s) Summary
Text-to-key conversion
indra/alscript/lsl/allsltoslua.cpp
The writer passes non-UUID strings to built-in key parameters with :: any. Other values, including UUID constants, retain key coercion.
Built-in call paths and validation
indra/alscript/lsl/allsltoslua.cpp, indra/alscript/tests/allsltoslua_test.cpp, indra/newview/skins/default/xui/en/strings.xml
Rule-table, ll, and llcompat calls enable built-in argument handling. Tests cover text, concatenated text, UUID literals, and script-defined key parameters. A new note describes the text behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: taylnos



Merge Risk: ⚪ Minimal · up to 3885a

The change is mergeable after normal checks; the supplied evidence establishes no actionable issue.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly describes the main change: preserving text passed to key parameters of ll and llcompat instead of converting it with uuid().
Description check Passed The description provides clear context, problem details, implementation scope, behavior for UUID literals and script-defined functions, and test results. It does not use the template headings, provide…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.


Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 2 files. (1 skipped: 1 unsupported.)




  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks each key with care,
Text stays text as it goes there.
UUIDs keep their proper track,
Tests confirm the values back.
I thump my paws and nibble hay,
Then hop along my merry way.

Comment @coderabbitai help to get the list of available commands.

…nction took it

SLua's ll and llcompat take a key argument as a uuid or as any string,
and the function itself decides whether the text is a key, as LSL's did.
The converter wrapped such text in uuid(), which the definitions' uuid
parameters asked for. But uuid() stops the script on text that is no
UUID: with no "selected" in the JSON, llKey2Name(llJsonGetValue(msg,
["selected"])) answered "" in LSL, and its conversion stopped the
script. The text is now given as it is, `:: any` telling the type
checker, with a note once a script saying why. A UUID written out is
still a uuid, and the script's own function's key parameter still takes
uuid(), since its body may compare it with one.

allsltoslua 84 (strict too, and close to LSL), and 23, whose
llGetOwnerKey("abc") is no longer uuid("abc").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RyeMutt
RyeMutt force-pushed the rye/script-key-text branch from 3885a7b to 7e9a2da Compare October 10, 2026 20:43
@RyeMutt
RyeMutt merged commit 9290594 into develop Oct 11, 2026
25 of 26 checks passed
@RyeMutt
RyeMutt deleted the rye/script-key-text branch October 11, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant