Skip to content

Fix #85: preserve dependent names when promoting to full agents#92

Merged
DeveshParagiri merged 1 commit intomainfrom
codex/issue-85-dependent-names
Feb 17, 2026
Merged

Fix #85: preserve dependent names when promoting to full agents#92
DeveshParagiri merged 1 commit intomainfrom
codex/issue-85-dependent-names

Conversation

@RandomOscillations
Copy link
Copy Markdown
Collaborator

@RandomOscillations RandomOscillations commented Feb 17, 2026

Summary

  • ensure promoted dependents carry first_name from dependent household metadata
  • preserve household last name when available for promoted dependents
  • add regression test verifying promoted dependent names align with generated household dependent records

Validation

  • pytest -q tests/test_agent_focus.py::TestPromotedDependentNames::test_promoted_dependents_preserve_household_names

Closes #85

Copy link
Copy Markdown
Collaborator

@DeveshParagiri DeveshParagiri left a comment

Choose a reason for hiding this comment

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

Code Review

Verdict: ✅ Ready to merge

Summary

Minimal 5-line fix that correctly extracts first_name from dependent metadata and preserves last_name from parent household.

Edge Cases Handled

Case Handling
Dependent has no name Falls back to sampled name (defensive getattr)
Household has no last_name No override, preserves sampled value
Whitespace-only name .strip() converts to empty, guard prevents assignment

Code

dep_name = str(getattr(dependent, "name", "")).strip()
if dep_name:
    agent["first_name"] = dep_name
if parent.get("last_name"):
    agent["last_name"] = parent["last_name"]

Tests

Regression test validates promoted dependents have names matching household metadata.

No changes required.

@DeveshParagiri DeveshParagiri merged commit 800ef60 into main Feb 17, 2026
5 of 6 checks passed
@DeveshParagiri DeveshParagiri deleted the codex/issue-85-dependent-names branch February 17, 2026 18:56
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.

Promoted dependents missing first_name — show as 'Agent' in conversations

2 participants