Skip to content

[RLHF Feedback]: Broke 30+ tests of the codebase while making optimizations #3

@deepak2431

Description

@deepak2431

Feedback

What did the agent do well?

  • Analyse the tradewise-backend codebase pattern across major APIs and found that the database level optimisation is one of the key bottlenecks to improve for the API performance.
  • Optimised the /api/dashboard/overview by implementing the caching logic for the policy updates filter.

What did the agent do badly?

  • It cached SQLAlchemy ORM objects directly in `_user_cache[user_id] = {"user": user, ...} at [utils/helpers.py:40-43], without considering that ORM objects become detached from their session and cause DetachedInstanceError on lazy-loaded relationship access.
  • It didn't analyse many API endpoints for the improvements, such as DocumentsList, ComplianceList, HSCodesList, etc.
  • Implemented the caching for a user query lookup, which was already an O(1), due to the user_id being the primary key.
  • Broke 28 test cases after wrapping up the optimisation implementation, which was due to the config updates done in the ORM session object.
  • Didn't run the test suites after making the changes to the APIs and code to ensure that the test cases are still passing and there are no regression issues introduced.

What does the agent learn?
NaN

As a senior developer, what is the ideal agent’s work behaviour?

  • List each API endpoint first available, and do a profiling of each of the APIs as where the major bottlenecks are for slow performance, where the data is big.
  • Prepare a plan for what sort of optimisation can be done at the database level, code level, and caching strategies.
  • Implement the code changes, and run tests to see if the API performance improved and what the new tradeoffs are.

Session

  • Pool version: v1.0.0
  • OS/arch: darwin/arm64
  • Session ID: 019dda93-5706-718e-8ca5-9cd7d25439f5
  • Agent server: default
  • Agent command: /Users/deepak/.local/bin/pool
  • Model: poolside/laguna-m.1
  • Timestamp: 2026-04-30T00:42:20+05:30

Logs

Attach this zip before submitting:

`

logs.zip

/logs.zip`

Logs and trajectory contain full prompt and response text from the session. Review before submitting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions