Add character import API handlers#1
Draft
mcagnion wants to merge 1 commit into
Draft
Conversation
5 tasks
mcagnion
added a commit
to mcagnion/pob-mcp
that referenced
this pull request
Apr 25, 2026
…ntegration Adds two new MCP tools that import a live PoE character into the loaded build via the official PoE character-window API. - lua_list_characters: HTTP-only listing (no Lua bridge required), sorted by lastLoginTime, displays class/ascendancy/league/realm/last login. - lua_import_character: replaces the active spec's tree, jewels, items, and skill gems with the in-game state. Returns a before/after diff (stats, items per slot, skill groups, tree node count) so callers can verify the import result. The feature works against the JSON-RPC handlers added on the matching PoB branch (see ianderse/PathOfBuilding#1). Configuration, build notes, other tree specs, and other item sets are preserved. Includes 41 unit tests covering the HTTP client, the handler flow (critical regression test for sequential bridge calls), and a schema guard against duplicate tool registration. POE_SESSION_ID env var documented for private profiles. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mcagnion
force-pushed
the
feature/import-poe-character
branch
from
April 25, 2026 12:51
3064947 to
0134cfe
Compare
Author
|
Rebased onto Diagnostic for posterity in case anyone hits the same wall:
Companion pob-mcp PR is ianderse/pob-mcp#8. 🤖 Generated with Claude Code |
mcagnion
added a commit
to mcagnion/pob-mcp
that referenced
this pull request
Apr 25, 2026
…ntegration Adds two new MCP tools that import a live PoE character into the loaded build via the official PoE character-window API. - lua_list_characters: HTTP-only listing (no Lua bridge required), sorted by lastLoginTime, displays class/ascendancy/league/realm/last login. - lua_import_character: replaces the active spec's tree, jewels, items, and skill gems with the in-game state. Returns a before/after diff (stats, items per slot, skill groups, tree node count) so callers can verify the import result. The feature works against the JSON-RPC handlers added on the matching PoB branch (see ianderse/PathOfBuilding#1). Configuration, build notes, other tree specs, and other item sets are preserved. Includes 41 unit tests covering the HTTP client, the handler flow (critical regression test for sequential bridge calls), and a schema guard against duplicate tool registration. POE_SESSION_ID env var documented for private profiles. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
charleslucas
added a commit
to charleslucas/PathOfBuilding
that referenced
this pull request
Jul 9, 2026
create_spec hand-rolled a plain Lua table with only a few fields, omitting jewels/nodes/allocNodes/etc. that a genuine PassiveSpec has. Native code that iterates every spec then crashed on the fake one — ItemsTab:DeleteItem does pairs(spec.jewels) during lua_import_character's clear-items step and threw 'bad argument ianderse#1 to pairs (table expected, got nil)', corrupting the import into a partial state (new tree, old items) that made every defensive stat wrong. Root-caused 2026-07-09 during a tree audit. Now uses PoB's own constructor + copy pattern (TreeTab.lua:599-602): new('PassiveSpec', build, treeVersion), copyTable(jewels), and RestoreUndoState(src:CreateUndoState(), version). The copy now also correctly preserves class/ascendancy (was dropping them: a Scavenger copy showed 'Scion/None, 77 nodes'; now 'Scion/Scavenger, 101 nodes'). Verified live: with a create_spec backup present, lua_import_character now completes fully (items included) instead of crashing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
Companion change for pob-mcp live character import support.