Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
coderai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
coderai
Commits
3e4b1ca6
Commit
3e4b1ca6
authored
Mar 01, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save sessions immediately on creation and after context compression
parent
1de9996c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
coder
coder
+6
-0
No files found.
coder
View file @
3e4b1ca6
...
@@ -608,6 +608,9 @@ class CoderClient:
...
@@ -608,6 +608,9 @@ class CoderClient:
# Replace with summary
# Replace with summary
self
.
conversation_history
=
[{
"role"
:
"system"
,
"content"
:
summary
}]
+
keep
self
.
conversation_history
=
[{
"role"
:
"system"
,
"content"
:
summary
}]
+
keep
# Save the updated session after compression
self
.
_save_current_session
()
def
_save_current_session
(
self
):
def
_save_current_session
(
self
):
"""Save current session if it has a name."""
"""Save current session if it has a name."""
...
@@ -643,6 +646,9 @@ class CoderClient:
...
@@ -643,6 +646,9 @@ class CoderClient:
timestamp
=
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d_
%
H
%
M
%
S"
)
timestamp
=
datetime
.
now
()
.
strftime
(
"
%
Y
%
m
%
d_
%
H
%
M
%
S"
)
self
.
session_name
=
f
"session_{timestamp}"
self
.
session_name
=
f
"session_{timestamp}"
# Save the new empty session immediately
self
.
_save_current_session
()
return
self
.
session_name
return
self
.
session_name
def
_handle_streaming_response
(
self
,
response
:
requests
.
Response
)
->
str
:
def
_handle_streaming_response
(
self
,
response
:
requests
.
Response
)
->
str
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment