Skip to content

Fix parent_tool_call foreign key inference#694

Closed
Gujiassh wants to merge 1 commit intocrmne:mainfrom
Gujiassh:fix/parent-tool-call-foreign-key
Closed

Fix parent_tool_call foreign key inference#694
Gujiassh wants to merge 1 commit intocrmne:mainfrom
Gujiassh:fix/parent-tool-call-foreign-key

Conversation

@Gujiassh
Copy link
Copy Markdown

Summary

  • derive parent_tool_call from the tool-call class by default, but honor custom namespaced association prefixes when tool_calls_foreign_key is explicitly provided
  • keep the fix scoped to the new acts_as API so it aligns with the already-correct legacy behavior without touching generators or docs
  • add focused namespaced ActiveRecord regressions covering both the reflected foreign key and real parent_tool_call persistence with a custom tool_calls association name

Validation

  • bundle exec rspec spec/ruby_llm/active_record/acts_as_spec.rb --example 'uses the tool_call_class-derived foreign key for parent_tool_call' --example 'persists parent_tool_call with a custom tool_calls association name'
  • bundle exec rspec spec/ruby_llm/active_record/acts_as_spec.rb
  • bundle exec rubocop lib/ruby_llm/active_record/acts_as.rb spec/ruby_llm/active_record/acts_as_spec.rb

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@Gujiassh
Copy link
Copy Markdown
Author

Closing this stale radar PR to keep the queue clean: it has been open for weeks without maintainer response, and I am not going to keep it in the active follow-up set without renewed upstream interest.

@Gujiassh Gujiassh closed this Apr 11, 2026
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.

1 participant