Skip to content

Fix client launch missing args - #13

Merged
benny-dreamly merged 10 commits into
sims4-devfrom
sims4-dev-client-fix
Dec 30, 2025
Merged

Fix client launch missing args#13
benny-dreamly merged 10 commits into
sims4-devfrom
sims4-dev-client-fix

Conversation

@benny-dreamly

@benny-dreamly benny-dreamly commented Dec 24, 2025

Copy link
Copy Markdown
Member

This PR should fix the client missing the ability to pass args, however I'm not sure at all, so this is being done in the development branch as a PR before it gets ported to the stable APWorld.

Summary by CodeRabbit

  • New Features

    • Launcher now accepts command-line arguments and uses an improved startup mechanism for more reliable client launches.
  • Bug Fixes

    • Process-start handling updated to improve stability during client launch.
  • Changes

    • Client entry point now accepts and forwards startup arguments for better argument parsing.
    • World manifest metadata fields removed, altering compatibility metadata.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 24, 2025

Copy link
Copy Markdown

Walkthrough

run_client(*args: str) now calls launch(main, name="The Sims 4 Client", args=args); launch was added to imports and multiprocessing.Process usage removed. Client.main signature changed to def main(args) and argument parsing now consumes the provided args. (≤50 words)

Changes

Cohort / File(s) Change Summary
Launcher API
worlds/sims4/__init__.py
run_client()def run_client(*args: str) -> None. Replaced creating a multiprocessing.Process(target=main) and p.start() with launch(main, name="The Sims 4 Client", args=args). Added launch to imports; removed direct multiprocessing.Process usage.
Client entry-point
worlds/sims4/Client.py
main()main(args). Argument parsing changed to parser.parse_known_args(args) and results bound to _args, _rest. SimsContext now initialized with _args.connect and _args.password. __main__ block calls main(None) explicitly.
Manifest
worlds/sims4/archipelago.json
Removed top-level metadata fields "version" and "compatible_version"; remaining fields unchanged.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hop through code where launches start,
Args tucked safe inside my cart,
No extra process takes a run,
One tidy call now gets it done,
I wiggle whiskers — change is art.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive The description is minimal and lacks required template sections like 'What is this fixing or adding?' and 'How was this tested?', though it provides basic context about the PR's purpose. Expand the description to include details about what the fix addresses, testing methodology, and clarity on whether the fix resolves the issue or remains uncertain.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix client launch missing args' directly describes the main change: enabling the client launcher to accept and pass command-line arguments.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sims4-dev-client-fix

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a1822ec and 1c08761.

📒 Files selected for processing (1)
  • worlds/sims4/archipelago.json
💤 Files with no reviewable changes (1)
  • worlds/sims4/archipelago.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Test Python 3.11 windows-latest
  • GitHub Check: Test Python 3.13 windows-latest
  • GitHub Check: Test Python 3.12 ubuntu-latest
  • GitHub Check: Test Python 3.13 macos-latest
  • GitHub Check: Test Python 3.13 ubuntu-latest
  • GitHub Check: Test Python 3.11.2 ubuntu-latest
  • GitHub Check: Test hosting with 3.13 on ubuntu-latest
  • GitHub Check: Test Python 3.11 windows-latest
  • GitHub Check: Test Python 3.11.2 ubuntu-latest
  • GitHub Check: Test Python 3.13 ubuntu-latest
  • GitHub Check: Test Python 3.12 ubuntu-latest
  • GitHub Check: Test Python 3.13 windows-latest
  • GitHub Check: Test Python 3.13 macos-latest
  • GitHub Check: Test hosting with 3.13 on ubuntu-latest

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

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

@benny-dreamly

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Dec 24, 2025

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6834d9 and 10804ff.

📒 Files selected for processing (1)
  • worlds/sims4/__init__.py
🧰 Additional context used
🧬 Code graph analysis (1)
worlds/sims4/__init__.py (1)
worlds/sims4/Client.py (1)
  • main (255-279)
🪛 GitHub Actions: Analyze modified files
worlds/sims4/__init__.py

[error] 22-22: Function is missing a return type annotation [no-untyped-def]


[error] 41-41: Key expression in dictionary comprehension has incompatible type "object"; expected type "str" [misc]


[error] 42-42: Key expression in dictionary comprehension has incompatible type "object"; expected type "str" [misc]


[error] 70-70: Argument 2 to "Sims4Item" has incompatible type "object"; expected "ItemClassification" [arg-type]


[error] 73-73: Function is missing a return type annotation [no-untyped-def]


[error] 83-83: No overload variant of "range" matches argument type "object" [call-overload]


[error] 83-83: No overload variant of "range" matches argument type "object" [call-overload]


[error] 84-84: Argument 1 to "create_item" of "Sims4World" has incompatible type "object"; expected "str" [arg-type]


[error] 95-95: Function is missing a return type annotation [no-untyped-def]


[error] 95-95: Function is missing a type annotation for one or more arguments [no-untyped-def]

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Test Python 3.13 ubuntu-latest
  • GitHub Check: Test Python 3.12 ubuntu-latest
  • GitHub Check: Test Python 3.11 windows-latest
  • GitHub Check: Test Python 3.13 windows-latest
  • GitHub Check: Test Python 3.11.2 ubuntu-latest
  • GitHub Check: Test Python 3.13 macos-latest
  • GitHub Check: Test hosting with 3.13 on ubuntu-latest
  • GitHub Check: Test Python 3.12 ubuntu-latest
  • GitHub Check: Test Python 3.13 windows-latest
  • GitHub Check: Test Python 3.13 ubuntu-latest
  • GitHub Check: Test Python 3.11.2 ubuntu-latest
  • GitHub Check: Test Python 3.13 macos-latest
  • GitHub Check: Test Python 3.11 windows-latest
🔇 Additional comments (1)
worlds/sims4/__init__.py (1)

7-7: The launch function properly handles the args parameter and forwards them correctly to the target function.

The launch function signature at line 112 of worlds/LauncherComponents.py accepts args: Tuple[str, ...] and forwards them correctly in both execution paths:

  • When Kivy is running: passes args to multiprocessing.Process(target=func, args=args), which unpacks and passes them as positional arguments
  • When Kivy is not running: calls func(*args) to unpack and pass them directly

No changes are needed.

Likely an incorrect or invalid review comment.

Comment thread worlds/sims4/__init__.py Outdated
Comment on lines +22 to +24
def run_client(*args: str):
from .Client import main
p = Process(target=main)
p.start()
launch(main, name="The Sims 4 Client", args=args)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add missing return type annotation to fix pipeline failure.

The function is missing a return type annotation, which is causing a pipeline failure.

🔎 Proposed fix
-def run_client(*args: str):
+def run_client(*args: str) -> None:
     from .Client import main
     launch(main, name="The Sims 4 Client", args=args)

Verify that arguments are properly passed to the client.

The refactoring from multiprocessing.Process to launch() looks cleaner, but you should verify that the args parameter flows correctly through to the client's argument parser. The main() function in Client.py uses parser.parse_known_args() without explicit arguments, which defaults to parsing sys.argv. Ensure that the launch function properly modifies sys.argv or passes arguments to enable the client to receive the intended command-line arguments.

You can test this by:

  1. Calling run_client() with test arguments (e.g., run_client('--connect', 'localhost:38281'))
  2. Verifying that the client receives and processes these arguments correctly
  3. Checking debug logs or adding print statements in the client to confirm argument reception
🧰 Tools
🪛 GitHub Actions: Analyze modified files

[error] 22-22: Function is missing a return type annotation [no-untyped-def]

🤖 Prompt for AI Agents
In worlds/sims4/__init__.py around lines 22-24, add an explicit return type
annotation to run_client (it should be -> None) to fix the pipeline failure;
also ensure the client receives the passed arguments by verifying how launch
propagates args — convert the variadic args to an argument list and either (A)
pass that list in the form launch expects so it replaces sys.argv for the child
process or (B) call the client entrypoint with those args directly if launch
does not modify sys.argv; run the suggested manual test (call
run_client('--connect', 'localhost:38281') and confirm parser.parse_known_args()
in Client.py sees the values) and adjust the call to launch or main accordingly.

@benny-dreamly

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Dec 24, 2025

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10804ff and fab2a99.

📒 Files selected for processing (1)
  • worlds/sims4/__init__.py
🧰 Additional context used
🧬 Code graph analysis (1)
worlds/sims4/__init__.py (1)
worlds/sims4/Client.py (1)
  • main (255-279)
🪛 GitHub Actions: Analyze modified files
worlds/sims4/__init__.py

[error] 11-11: F401 'Items.skills_table' imported but unused


[error] 13-13: F401 'Regions.sims4_skill_dependencies' imported but unused


[error] 13-13: F401 'Regions.sims4_regions' imported but unused


[error] 22-22: E302 expected 2 blank lines, found 1


[error] 31-31: E302 expected 2 blank lines, found 1


[error] 66-66: E303 too many blank lines (2)


[error] 77-77: E501 line too long (123 > 120 characters)


[error] 119-119: E501 line too long (123 > 120 characters)


[error] 132-132: E501 line too long (134 > 120 characters)


[warning] 132-132: W505 doc line too long (134 > 120 characters)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Test Python 3.12 ubuntu-latest
  • GitHub Check: Test Python 3.13 macos-latest
  • GitHub Check: Test Python 3.13 windows-latest
  • GitHub Check: Test Python 3.11 windows-latest
  • GitHub Check: Test Python 3.13 ubuntu-latest
  • GitHub Check: Test Python 3.11.2 ubuntu-latest
  • GitHub Check: Test Python 3.12 ubuntu-latest
  • GitHub Check: Test Python 3.11 windows-latest
  • GitHub Check: Test Python 3.13 macos-latest
  • GitHub Check: Test Python 3.13 windows-latest
🔇 Additional comments (2)
worlds/sims4/__init__.py (2)

7-7: LGTM - Import addition is correct.

The addition of launch to the imports is necessary for the new implementation and properly structured.


22-22: Return type annotation added successfully.

The return type annotation -> None has been added, addressing the previous pipeline failure.

Comment thread worlds/sims4/__init__.py
from .Version import VERSION, Sims4Version

def run_client():
def run_client(*args: str) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix formatting: Add blank lines before function and class definitions.

The pipeline is failing due to PEP 8 violations. Module-level function and class definitions require 2 blank lines before them.

🔎 Proposed fix

Add a blank line before line 22:

 from .Version import VERSION, Sims4Version
 
+
 def run_client(*args: str) -> None:
     from .Client import main
     launch(main, name="The Sims 4 Client", args=args)

Add a blank line before line 31:

 icon_paths["plumbob"] = f"ap:{__name__}/icons/plumbob.png"
 
+
 class Sims4World(World, UTMixin):
     """
     The Sims 4 is the fourth installment in The Sims franchise. Like the previous games in the series,

Also applies to: 31-31

🧰 Tools
🪛 GitHub Actions: Analyze modified files

[error] 22-22: E302 expected 2 blank lines, found 1

🤖 Prompt for AI Agents
In worlds/sims4/__init__.py around lines 22 and 31, PEP8 requires two blank
lines before module-level function and class definitions; add one additional
blank line immediately above the def run_client at line 22 and likewise add a
blank line immediately above the class/function at line 31 so there are two
blank lines separating them from previous top-level code/comments.

Comment thread worlds/sims4/__init__.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fab2a99 and a176612.

📒 Files selected for processing (1)
  • worlds/sims4/Client.py
🧰 Additional context used
🪛 GitHub Actions: Analyze modified files
worlds/sims4/Client.py

[error] 255-255: mypy: Function parameters cannot be parenthesized. [syntax]

🪛 Ruff (0.14.10)
worlds/sims4/Client.py

255-255: Expected ), found (

(invalid-syntax)


255-256: Expected an expression

(invalid-syntax)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
  • GitHub Check: build (arm64, ubuntu-24.04-arm, arm64, arm64)
  • GitHub Check: build (amd64, ubuntu-latest, amd64, amd64)
  • GitHub Check: fuzz
  • GitHub Check: Test Python 3.11.2 ubuntu-latest
  • GitHub Check: Test Python 3.12 ubuntu-latest
  • GitHub Check: Test Python 3.11 windows-latest
  • GitHub Check: Test Python 3.13 macos-latest
  • GitHub Check: Test Python 3.13 windows-latest
  • GitHub Check: Test Python 3.13 ubuntu-latest
  • GitHub Check: Test hosting with 3.13 on ubuntu-latest
  • GitHub Check: Test Python 3.13 macos-latest
  • GitHub Check: Test Python 3.13 windows-latest
  • GitHub Check: Test Python 3.11 windows-latest
  • GitHub Check: Test Python 3.13 ubuntu-latest
  • GitHub Check: Test Python 3.11.2 ubuntu-latest
  • GitHub Check: Test Python 3.12 ubuntu-latest
  • GitHub Check: Test hosting with 3.13 on ubuntu-latest

Comment thread worlds/sims4/Client.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
worlds/sims4/Client.py (1)

255-255: Fix the missing default parameter.

The function signature requires an args parameter, but line 283 calls main() without arguments. This will raise a TypeError when the file is executed directly.

🔎 Proposed fix
-def main(args):
+def main(args=None):
🧹 Nitpick comments (1)
worlds/sims4/Client.py (1)

258-258: Consider prefixing the unused variable.

The rest variable is unpacked but never used. Consider prefixing it with an underscore to indicate it's intentionally unused.

🔎 Proposed fix
-        _args, rest = parser.parse_known_args(args)
+        _args, _rest = parser.parse_known_args(args)
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a176612 and 6bd02f7.

⛔ Files ignored due to path filters (2)
  • .github/workflows/build.yml is excluded by none and included by none
  • .github/workflows/docker.yml is excluded by none and included by none
📒 Files selected for processing (1)
  • worlds/sims4/Client.py
🧰 Additional context used
🪛 Ruff (0.14.10)
worlds/sims4/Client.py

258-258: Unpacked variable rest is never used

Prefix it with an underscore or any other dummy variable pattern

(RUF059)

🔇 Additional comments (1)
worlds/sims4/Client.py (1)

260-260: LGTM!

The context initialization correctly uses the parsed _args instead of the shadowed args variable. This properly addresses the issue flagged in the previous review.

@benny-dreamly

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Dec 27, 2025

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6bd02f7 and aa96325.

📒 Files selected for processing (1)
  • worlds/sims4/Client.py
🧰 Additional context used
🪛 GitHub Actions: Analyze modified files
worlds/sims4/Client.py

[error] 11-11: F401 'CommonClient.logger' imported but unused


[error] 21-21: E402 module level import not at top of file


[error] 25-25: E302 expected 2 blank lines, found 1


[error] 30-30: E305 expected 2 blank lines after class or function definition, found 1


[error] 37-37: E302 expected 2 blank lines, found 1


[error] 41-41: F541 f-string is missing placeholders


[error] 41-41: E501 line too long (126 > 120 characters)


[error] 46-46: E305 expected 2 blank lines after class or function definition, found 1


[error] 76-76: F541 f-string is missing placeholders


[error] 102-102: F541 f-string is missing placeholders


[error] 104-104: E501 line too long (168 > 120 characters)


[error] 173-173: F811 redefinition of unused 'logger' from line 11


[error] 178-178: E303 too many blank lines (2)


[error] 192-192: E303 too many blank lines (2)


[error] 200-200: E501 line too long (132 > 120 characters)


[error] 226-226: E501 line too long (122 > 120 characters)


[error] 234-234: E501 line too long (142 > 120 characters)


[error] 246-246: E128 continuation line under-indented for visual indent

🔇 Additional comments (1)
worlds/sims4/Client.py (1)

255-260: LGTM! Argument passing pattern is correct.

The function signature and argument handling are now properly implemented. The args parameter is correctly passed to parse_known_args(args), and the parsed result is used for context initialization. The variable naming (_args) appropriately avoids shadowing the input parameter.

Comment thread worlds/sims4/Client.py Outdated

@silasary silasary left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, and looks similar to what I've done elsewhere.

I have not got a chance to test it.

@benny-dreamly
benny-dreamly merged commit 5d36885 into sims4-dev Dec 30, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants