Skip to content

Increase number of lines for tunnel info logs#1404

Merged
deep1401 merged 3 commits intomainfrom
fix/increase-tunnel-info-lines
Feb 26, 2026
Merged

Increase number of lines for tunnel info logs#1404
deep1401 merged 3 commits intomainfrom
fix/increase-tunnel-info-lines

Conversation

@deep1401
Copy link
Copy Markdown
Member

@deep1401 deep1401 commented Feb 25, 2026

Summary by CodeRabbit

  • Enhancements
    • Increased default log retrieval amount for job logs and tunnel information endpoints from 400 to 1000 lines, allowing users to see more historical data by default.
    • Expanded maximum log retrieval limit from 2000 to 5000 lines for greater flexibility when troubleshooting.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

Updated default tail_lines parameter values across backend and frontend API endpoints from 400 to 1000, with corresponding adjustment of validation bounds from 2000 to 5000 in backend endpoints. No functional or control flow changes.

Changes

Cohort / File(s) Summary
Log Tail Lines Default Updates
api/transformerlab/routers/experiment/jobs.py
Increased tail_lines default parameter from 400 to 1000 for get_provider_job_logs and get_tunnel_info_for_job endpoints; updated validation bounds to ge=100, le=5000 accordingly.
Frontend API Client
src/renderer/lib/api-client/endpoints.ts
Increased tailLines default parameter from 400 to 1000 in GetTunnelInfo method signature.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A hop, a skip, through logs we peek,
More lines to read, the answers we seek,
From four to ten, a generous fold,
More history's secrets waiting to be told,
Nibbled with care, this change feels right,
🐰✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: increasing the default tail_lines parameter from 400 to 1000 for tunnel info log endpoints.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/increase-tunnel-info-lines

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

@sentry
Copy link
Copy Markdown

sentry bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
api/transformerlab/routers/experiment/jobs.py (1)

363-370: LGTM – but add a return type annotation per coding guidelines.

The default/bounds update is correct. The function signature lacks a return type annotation, which is mandatory for api/**/*.py.

♻️ Proposed fix
-async def get_tunnel_info_for_job(
+async def get_tunnel_info_for_job(  # type: ignore[return]

or more correctly, annotate the actual return type:

-async def get_tunnel_info_for_job(
+async def get_tunnel_info_for_job(  # noqa

A concrete diff (the return type mirrors the response dict structure):

 async def get_tunnel_info_for_job(
     experimentId: str,
     job_id: str,
     tail_lines: int = Query(1000, ge=100, le=5000),
     user_and_team=Depends(get_user_and_team),
     session: AsyncSession = Depends(get_async_session),
-):
+) -> dict:

As per coding guidelines: "Mandatory type hints for all Python function arguments and return types."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api/transformerlab/routers/experiment/jobs.py` around lines 363 - 370, Add a
return type annotation to the get_tunnel_info_for_job function signature
(currently defined as async def get_tunnel_info_for_job(...)) to satisfy
mandatory type hints; update it to something like -> Dict[str, Any] or the more
precise dict[str, Any] that matches the response dict structure returned by this
endpoint, and add the necessary import(s) (from typing import Dict, Any) at the
top of the file if not present; ensure the annotation appears on the function
that includes parameters experimentId, job_id, tail_lines and dependencies
(get_user_and_team, get_async_session).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@api/transformerlab/routers/experiment/jobs.py`:
- Around line 363-370: Add a return type annotation to the
get_tunnel_info_for_job function signature (currently defined as async def
get_tunnel_info_for_job(...)) to satisfy mandatory type hints; update it to
something like -> Dict[str, Any] or the more precise dict[str, Any] that matches
the response dict structure returned by this endpoint, and add the necessary
import(s) (from typing import Dict, Any) at the top of the file if not present;
ensure the annotation appears on the function that includes parameters
experimentId, job_id, tail_lines and dependencies (get_user_and_team,
get_async_session).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eab1c94 and 4b2f315.

📒 Files selected for processing (2)
  • api/transformerlab/routers/experiment/jobs.py
  • src/renderer/lib/api-client/endpoints.ts

@deep1401 deep1401 merged commit 38cea3d into main Feb 26, 2026
9 of 10 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